X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=index.php;h=b6ee8ebc482b585e01bf858bc97ae90184b172c1;hb=5c06c0870f8e425c2d4ed0f7c330c13e1605628e;hp=220847f5ec4f3469af3e2eb32e08b5f6cc2c4ab9;hpb=d8030c8155ee4c20573848b2444f6df0b65d1662;p=github%2Fshaarli%2FShaarli.git diff --git a/index.php b/index.php index 220847f5..b6ee8ebc 100644 --- a/index.php +++ b/index.php @@ -151,6 +151,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) + )); +}