diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-10-20 18:32:46 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2020-10-20 18:32:46 +0200 |
commit | 5c06c0870f8e425c2d4ed0f7c330c13e1605628e (patch) | |
tree | dae15a87762c4a95c2b1622fad6391e55373486f /application/Utils.php | |
parent | d8030c8155ee4c20573848b2444f6df0b65d1662 (diff) | |
download | Shaarli-5c06c0870f8e425c2d4ed0f7c330c13e1605628e.tar.gz Shaarli-5c06c0870f8e425c2d4ed0f7c330c13e1605628e.tar.zst Shaarli-5c06c0870f8e425c2d4ed0f7c330c13e1605628e.zip |
Dislay an error if an exception occurs in the error handler
Related to #1598
Diffstat (limited to 'application/Utils.php')
-rw-r--r-- | application/Utils.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/application/Utils.php b/application/Utils.php index bcfda65c..37be9a13 100644 --- a/application/Utils.php +++ b/application/Utils.php | |||
@@ -463,3 +463,12 @@ function t($text, $nText = '', $nb = 1, $domain = 'shaarli') | |||
463 | { | 463 | { |
464 | return dn__($domain, $text, $nText, $nb); | 464 | return dn__($domain, $text, $nText, $nb); |
465 | } | 465 | } |
466 | |||
467 | /** | ||
468 | * Converts an exception into a printable stack trace string. | ||
469 | */ | ||
470 | function exception2text(Throwable $e): string | ||
471 | { | ||
472 | return $e->getMessage() . PHP_EOL . $e->getFile() . $e->getLine() . PHP_EOL . $e->getTraceAsString(); | ||
473 | } | ||
474 | |||