diff --git a/index.php b/index.php index 7667b701..9b3eed63 100644 --- a/index.php +++ b/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 = <<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; }