mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-23 23:16:53 +00:00
[index] Improve error message for data transformation
Replace error message and add additional information: - Name of the bridge - Possible solutions - Error description - Error code - Error message The error description also includes an URI to create a new issue on GitHub based on the given error information (prepared).
This commit is contained in:
parent
6f6aaa3aec
commit
21a5547f96
27
index.php
27
index.php
@ -177,7 +177,32 @@ try {
|
||||
$format->setExtraInfos($bridge->getExtraInfos());
|
||||
$format->display();
|
||||
} catch(Exception $e){
|
||||
echo "The bridge has crashed. You should report this to the bridges maintainer";
|
||||
$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);
|
||||
}
|
||||
die;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user