mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-13 20:14:10 +02:00
refactor (#3668)
This commit is contained in:
@@ -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();
|
||||
|
||||
|
Reference in New Issue
Block a user