This commit is contained in:
Dag 2023-09-20 02:45:48 +02:00 committed by GitHub
parent cf7e3eea56
commit e6aef73a02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 134 additions and 384 deletions

View file

@ -84,7 +84,7 @@ class DisplayAction implements ActionInterface
return $response;
}
private function createResponse(array $request, BridgeInterface $bridge, FormatInterface $format)
private function createResponse(array $request, BridgeAbstract $bridge, FormatInterface $format)
{
$items = [];
$infos = [];
@ -110,8 +110,6 @@ class DisplayAction implements ActionInterface
'icon' => $bridge->getIcon()
];
} catch (\Exception $e) {
$errorOutput = Configuration::getConfig('error', 'output');
$reportLimit = Configuration::getConfig('error', 'report_limit');
if ($e instanceof HttpException) {
// Reproduce (and log) these responses regardless of error output and report limit
if ($e->getCode() === 429) {
@ -124,6 +122,8 @@ class DisplayAction implements ActionInterface
}
}
Logger::error(sprintf('Exception in DisplayAction(%s)', $bridge->getShortName()), ['e' => $e]);
$errorOutput = Configuration::getConfig('error', 'output');
$reportLimit = Configuration::getConfig('error', 'report_limit');
$errorCount = 1;
if ($reportLimit > 1) {
$errorCount = $this->logBridgeError($bridge->getName(), $e->getCode());
@ -152,7 +152,7 @@ class DisplayAction implements ActionInterface
return new Response($format->stringify(), 200, $headers);
}
private function createFeedItemFromException($e, BridgeInterface $bridge): FeedItem
private function createFeedItemFromException($e, BridgeAbstract $bridge): FeedItem
{
$item = new FeedItem();