diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-10-20 21:37:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-20 21:37:20 +0200 |
commit | 344544334961370388a2ea2eb72bb9827703d725 (patch) | |
tree | dae15a87762c4a95c2b1622fad6391e55373486f /index.php | |
parent | d8030c8155ee4c20573848b2444f6df0b65d1662 (diff) | |
parent | 5c06c0870f8e425c2d4ed0f7c330c13e1605628e (diff) | |
download | Shaarli-344544334961370388a2ea2eb72bb9827703d725.tar.gz Shaarli-344544334961370388a2ea2eb72bb9827703d725.tar.zst Shaarli-344544334961370388a2ea2eb72bb9827703d725.zip |
Merge pull request #1602 from ArthurHoaro/fix/root-exceptions
Dislay an error if an exception occurs in the error handler
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -151,6 +151,12 @@ $app->group('/api/v1', function () { | |||
151 | $this->get('/history', '\Shaarli\Api\Controllers\HistoryController:getHistory')->setName('getHistory'); | 151 | $this->get('/history', '\Shaarli\Api\Controllers\HistoryController:getHistory')->setName('getHistory'); |
152 | })->add('\Shaarli\Api\ApiMiddleware'); | 152 | })->add('\Shaarli\Api\ApiMiddleware'); |
153 | 153 | ||
154 | $response = $app->run(true); | 154 | try { |
155 | 155 | $response = $app->run(true); | |
156 | $app->respond($response); | 156 | $app->respond($response); |
157 | } catch (Throwable $e) { | ||
158 | die(nl2br( | ||
159 | 'An unexpected error happened, and the error template could not be displayed.' . PHP_EOL . PHP_EOL . | ||
160 | exception2text($e) | ||
161 | )); | ||
162 | } | ||