mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-04 10:04:54 +02:00
[index] Improve error handling (#555)
Add additional information to error message: - Name of the bridge - Possible solutions - Error description - Error code - Error message * Output type changed from 'text' to 'html' * Added styles for the error page * Added a button to remotely open a GitHub issue Closes #525
This commit is contained in:
parent
6e4bc341b7
commit
38b56bf23a
3 changed files with 195 additions and 3 deletions
15
index.php
15
index.php
|
@ -162,8 +162,14 @@ try {
|
|||
unset($params['_noproxy']);
|
||||
|
||||
// Load cache & data
|
||||
$bridge->setCache($cache);
|
||||
$bridge->setDatas($params);
|
||||
try {
|
||||
$bridge->setCache($cache);
|
||||
$bridge->setDatas($params);
|
||||
} catch(Exception $e){
|
||||
header('HTTP/1.1 ' . $e->getCode() . ' ' . Http::getMessageForCode($e->getCode()));
|
||||
header('Content-Type: text/html');
|
||||
die(buildBridgeException($e, $bridge));
|
||||
}
|
||||
|
||||
// Data transformation
|
||||
try {
|
||||
|
@ -172,8 +178,11 @@ try {
|
|||
$format->setExtraInfos($bridge->getExtraInfos());
|
||||
$format->display();
|
||||
} catch(Exception $e){
|
||||
echo "The bridge has crashed. You should report this to the bridges maintainer";
|
||||
header('HTTP/1.1 ' . $e->getCode() . ' ' . Http::getMessageForCode($e->getCode()));
|
||||
header('Content-Type: text/html');
|
||||
die(buildTransformException($e, $bridge));
|
||||
}
|
||||
|
||||
die;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue