1
0
Fork 0
mirror of synced 2024-09-30 17:26:48 +13:00

Fix client error reporting

This commit is contained in:
Matej Bačo 2024-02-02 14:33:52 +01:00
parent b07bdf610a
commit 4115537f72

View file

@ -607,10 +607,11 @@ App::error()
->action(function (Throwable $error, App $utopia, Request $request, Response $response, Document $project, ?Logger $logger, Log $log) {
$version = App::getEnv('_APP_VERSION', 'UNKNOWN');
$route = $utopia->getRoute();
$publish = true;
if ($error instanceof AppwriteException) {
$publish = $error->isPublishable();
} else {
$publish = $error->getCode() === 0 || $error->getCode() >= 500;
}
if ($logger && ($publish || $error->getCode() === 0)) {