mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-31 15:30:01 +02:00
feat: improve error handling ux (#3298)
* feat: improve error handling ux * feat: add error messages for failed xml parsing
This commit is contained in:
parent
9e9a697b8b
commit
4c3ebb312d
4 changed files with 70 additions and 27 deletions
|
@ -102,7 +102,7 @@ abstract class FeedExpander extends BridgeAbstract
|
|||
$httpHeaders = ['Accept: ' . implode(', ', $mimeTypes)];
|
||||
$content = getContents($url, $httpHeaders);
|
||||
if ($content === '') {
|
||||
throw new \Exception(sprintf('Unable to parse xml from `%s` because we got the empty string', $url));
|
||||
throw new \Exception(sprintf('Unable to parse xml from `%s` because we got the empty string', $url), 10);
|
||||
}
|
||||
// Maybe move this call earlier up the stack frames
|
||||
// Disable triggering of the php error-handler and handle errors manually instead
|
||||
|
@ -121,7 +121,7 @@ abstract class FeedExpander extends BridgeAbstract
|
|||
// Render only the first error into exception message
|
||||
$firstXmlErrorMessage = $xmlErrors[0]->message;
|
||||
}
|
||||
throw new \Exception(sprintf('Unable to parse xml from `%s` %s', $url, $firstXmlErrorMessage ?? ''));
|
||||
throw new \Exception(sprintf('Unable to parse xml from `%s` %s', $url, $firstXmlErrorMessage ?? ''), 11);
|
||||
}
|
||||
// Restore previous behaviour in case other code relies on it being off
|
||||
libxml_use_internal_errors(false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue