fix: catch everything (#2837)

Improve ux.
This commit is contained in:
Dag 2022-06-22 18:32:22 +02:00 committed by GitHub
parent ee80f4918e
commit e7aebb223d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -25,11 +25,14 @@ try {
$showInactive = filter_input(INPUT_GET, 'show_inactive', FILTER_VALIDATE_BOOLEAN); $showInactive = filter_input(INPUT_GET, 'show_inactive', FILTER_VALIDATE_BOOLEAN);
echo BridgeList::create($showInactive); echo BridgeList::create($showInactive);
} }
} catch(\Exception $e) { } catch(\Throwable $e) {
error_log($e); error_log($e);
$code = $e->getCode(); $code = $e->getCode();
if ($code !== -1) { if ($code !== -1) {
header('Content-Type: text/plain', true, $code); header('Content-Type: text/plain', true, $code);
} }
die($e->getMessage());
$message = sprintf("Uncaught Exception %s: '%s'\n", get_class($e), $e->getMessage());
print $message;
} }