1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-20 07:11:43 +02:00

refactor: extract exception and cache middleware (#4248)

This commit is contained in:
Dag
2024-09-01 21:48:14 +02:00
committed by GitHub
parent 36fd72c87e
commit a6bdc322b0
8 changed files with 99 additions and 56 deletions

View File

@@ -63,13 +63,8 @@ if ($argv) {
$request = Request::fromGlobals();
}
try {
$rssBridge = new RssBridge($container);
$response = $rssBridge->main($request);
$response->send();
} catch (\Throwable $e) {
// Probably an exception inside an action
$logger->error('Exception in RssBridge::main()', ['e' => $e]);
$response = new Response(render(__DIR__ . '/templates/exception.html.php', ['e' => $e]), 500);
$response->send();
}
$rssBridge = new RssBridge($container);
$response = $rssBridge->main($request);
$response->send();