mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-23 23:16:53 +00:00
[index] Copy error message for load of cache and data
This adds the same error message for load of cache and data as used for data transformation. Notice: Errors during data transformation are less likely if data loading succeeded.
This commit is contained in:
parent
21a5547f96
commit
431e35e07f
29
index.php
29
index.php
@ -162,8 +162,37 @@ try {
|
||||
unset($params['_noproxy']);
|
||||
|
||||
// Load cache & data
|
||||
try {
|
||||
$bridge->setCache($cache);
|
||||
$bridge->setDatas($params);
|
||||
} catch(Exception $e){
|
||||
$title = urlencode($bridge->getName() . ' failed with error ' . $e->getCode());
|
||||
$body = urlencode('Error message: ' . $e->getmessage());
|
||||
$link = 'https://github.com/rss-bridge/rss-bridge/issues/new?title='
|
||||
. $title
|
||||
. '&body='
|
||||
. $body
|
||||
. '&labels=bug+report'
|
||||
. '&assignee='
|
||||
. $bridge->getMaintainer();
|
||||
|
||||
$message = <<<EOD
|
||||
{$bridge->getName()} was unable to receive or process the remote website's content.
|
||||
Check your input parameters or press F5 to retry.
|
||||
|
||||
Use the following link to notify the bridge maintainer if this error persists:
|
||||
$link
|
||||
|
||||
Additional info:
|
||||
|
||||
Error code: "{$e->getCode()}"
|
||||
Message: "{$e->getMessage()}"
|
||||
EOD;
|
||||
|
||||
header('HTTP/1.1 ' . $e->getCode() . ' ' . Http::getMessageForCode($e->getCode()));
|
||||
header('Content-Type: text/plain');
|
||||
die($message);
|
||||
}
|
||||
|
||||
// Data transformation
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user