mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-05 02:24:35 +02:00
refactor (#3668)
This commit is contained in:
parent
cf7e3eea56
commit
e6aef73a02
15 changed files with 134 additions and 384 deletions
|
@ -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();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue