diff options
| author | Andrew Dolgov <fox@fakecake.org> | 2025-05-04 09:36:27 +0000 |
|---|---|---|
| committer | Andrew Dolgov <fox@fakecake.org> | 2025-05-04 09:36:27 +0000 |
| commit | bb0a136944cbb60b44d655bf8e50553119210578 (patch) | |
| tree | cf6b5464b3d3be667444316608d369a081016e6d /include/errorhandler.php | |
| parent | bc0da8edb699eec9fb6424bb5d8650ac48dca69d (diff) | |
| parent | 01159fa6f8c2421457297914dd42039bc12b826e (diff) | |
Merge branch 'cringe-jobs' into 'master'
Cringe jobs
See merge request tt-rss/tt-rss!124
Diffstat (limited to 'include/errorhandler.php')
| -rw-r--r-- | include/errorhandler.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/errorhandler.php b/include/errorhandler.php index c155c9989..2b6d51a7d 100644 --- a/include/errorhandler.php +++ b/include/errorhandler.php @@ -49,6 +49,11 @@ function ttrss_error_handler(int $errno, string $errstr, string $file, int $line $context = format_backtrace(debug_backtrace()); $errstr = truncate_middle($errstr, 16384, " (...) "); + if (php_sapi_name() == 'cli' && class_exists("Debug")) { + Debug::log("!! Exception: $errstr ($file:$line)"); + Debug::log($context); + } + if (class_exists("Logger")) return Logger::log_error((int)$errno, $errstr, $file, (int)$line, $context); else @@ -70,6 +75,11 @@ function ttrss_fatal_handler(): bool { $file = substr(str_replace(dirname(__DIR__), "", $file), 1); + if (php_sapi_name() == 'cli' && class_exists("Debug")) { + Debug::log("!! Fatal error: $errstr ($file:$line)"); + Debug::log($context); + } + if (class_exists("Logger")) return Logger::log_error((int)$errno, $errstr, $file, (int)$line, $context); } |