1
0
Fork 0
mirror of synced 2024-10-02 10:16:27 +13:00

Fix: Logger throwing fatal error

This commit is contained in:
Damodar Lohani 2024-09-26 16:29:07 +05:45 committed by GitHub
parent cfc36a9f47
commit 77ccec337e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -863,8 +863,12 @@ App::error()
$isProduction = System::getEnv('_APP_ENV', 'development') === 'production';
$log->setEnvironment($isProduction ? Log::ENVIRONMENT_PRODUCTION : Log::ENVIRONMENT_STAGING);
$responseCode = $logger->addLog($log);
Console::info('Log pushed with status code: ' . $responseCode);
try {
$responseCode = $logger->addLog($log);
Console::info('Log pushed with status code: ' . $responseCode);
} catch (Throwable $th) {
Console::error('Error pushing log: ' . $th->getMessage())
}
}
/** Wrap all exceptions inside Appwrite\Extend\Exception */