mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-31 13:50:23 +02:00
fix: improve FeedExpander (#3103)
* fix: improve FeedExpander Include the first libxml error in exception. Give better error message if trying to parse the empty string. Log all libxml errors if debug mode is enabled. * error handling and logging tweak
This commit is contained in:
@@ -41,7 +41,25 @@ final class RssBridge
|
||||
// Drop the current frame
|
||||
Logger::warning($text);
|
||||
if (Debug::isEnabled()) {
|
||||
print sprintf('<pre>%s</pre>', $text);
|
||||
print sprintf("<pre>%s</pre>\n", e($text));
|
||||
}
|
||||
});
|
||||
|
||||
// There might be some fatal errors which are not caught by set_error_handler() or \Throwable.
|
||||
register_shutdown_function(function () {
|
||||
$error = error_get_last();
|
||||
if ($error) {
|
||||
$message = sprintf(
|
||||
'Fatal Error %s: %s in %s line %s',
|
||||
$error['type'],
|
||||
$error['message'],
|
||||
trim_path_prefix($error['file']),
|
||||
$error['line']
|
||||
);
|
||||
Logger::error($message);
|
||||
if (Debug::isEnabled()) {
|
||||
print sprintf("<pre>%s</pre>\n", e($message));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user