X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=index.php;h=1b10ee41c8299f196b510bde155d6c09e8bd045b;hb=820cae27cfcc94af552818f3f1e5342e00478f6c;hp=ea6e8501f1e39f4f613765433e3ea561fdf5d69e;hpb=b38a1b0209f546d4824a0db81a34c4e30fcdebaf;p=github%2Fshaarli%2FShaarli.git diff --git a/index.php b/index.php index ea6e8501..1b10ee41 100644 --- a/index.php +++ b/index.php @@ -166,6 +166,12 @@ $app->group('/api/v1', function () { $this->get('/history', '\Shaarli\Api\Controllers\HistoryController:getHistory')->setName('getHistory'); })->add('\Shaarli\Api\ApiMiddleware'); -$response = $app->run(true); - -$app->respond($response); +try { + $response = $app->run(true); + $app->respond($response); +} catch (Throwable $e) { + die(nl2br( + 'An unexpected error happened, and the error template could not be displayed.' . PHP_EOL . PHP_EOL . + exception2text($e) + )); +}