]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - index.php
Merge pull request #1601 from ArthurHoaro/feature/psr3
[github/shaarli/Shaarli.git] / index.php
index ea6e8501f1e39f4f613765433e3ea561fdf5d69e..1b10ee41c8299f196b510bde155d6c09e8bd045b 100644 (file)
--- 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)
+    ));
+}