Merge pull request #2964 from appwrite/fix-double-event-log

Fix PDOException double event log
This commit is contained in:
Christy Jacob 2022-03-18 23:47:49 +04:00 committed by GitHub
commit 1aa0be51bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -321,6 +321,10 @@ App::error(function ($error, $utopia, $request, $response, $layout, $project, $l
$version = App::getEnv('_APP_VERSION', 'UNKNOWN');
$route = $utopia->match($request);
if ($error instanceof PDOException) {
throw $error;
}
if($logger) {
if($error->getCode() >= 500 || $error->getCode() === 0) {
try {
@ -371,10 +375,6 @@ App::error(function ($error, $utopia, $request, $response, $layout, $project, $l
}
}
if ($error instanceof PDOException) {
throw $error;
}
$code = $error->getCode();
$message = $error->getMessage();
$file = $error->getFile();