mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-24 04:34:56 +02:00
feat: improve error handling (#2902)
This commit is contained in:
parent
c992bcc8bf
commit
abc4af43b3
10 changed files with 180 additions and 254 deletions
13
index.php
13
index.php
|
@ -26,7 +26,18 @@ try {
|
|||
}
|
||||
} catch (\Throwable $e) {
|
||||
error_log($e);
|
||||
|
||||
$message = sprintf(
|
||||
'Uncaught Exception %s: %s at %s line %s',
|
||||
get_class($e),
|
||||
$e->getMessage(),
|
||||
trim_path_prefix($e->getFile()),
|
||||
$e->getLine()
|
||||
);
|
||||
|
||||
http_response_code(500);
|
||||
print render('error.html.php', [
|
||||
'message' => sprintf("Uncaught Exception %s: '%s'\n", get_class($e), $e->getMessage()),
|
||||
'message' => $message,
|
||||
'stacktrace' => create_sane_stacktrace($e),
|
||||
]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue