diff options
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 7a9d2645..bc1c9f5d 100644 --- a/application/Utils.php +++ b/application/Utils.php | |||
@@ -465,3 +465,12 @@ function t($text, $nText = '', $nb = 1, $domain = 'shaarli') | |||
465 | { | 465 | { |
466 | return dn__($domain, $text, $nText, $nb); | 466 | return dn__($domain, $text, $nText, $nb); |
467 | } | 467 | } |
468 | |||
469 | /** | ||
470 | * Converts an exception into a printable stack trace string. | ||
471 | */ | ||
472 | function exception2text(Throwable $e): string | ||
473 | { | ||
474 | return $e->getMessage() . PHP_EOL . $e->getFile() . $e->getLine() . PHP_EOL . $e->getTraceAsString(); | ||
475 | } | ||
476 | |||