Merge pull request #12579 from MrPetovan/bug/fatal-errors

Add previous exception to unexpected worker exception logging
This commit is contained in:
Philipp 2022-12-31 10:08:30 +01:00 committed by GitHub
commit 2844ea779d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -574,7 +574,7 @@ class Worker
// No need to defer a worker queue entry if the arguments are invalid
Logger::notice('Wrong worker arguments', ['class' => $funcname, 'argv' => $argv, 'queue' => $queue, 'message' => $e->getMessage()]);
} catch (\Throwable $e) {
Logger::error('Uncaught exception in worker execution', ['class' => get_class($e), 'message' => $e->getMessage(), 'code' => $e->getCode(), 'file' => $e->getFile() . ':' . $e->getLine(), 'trace' => $e->getTraceAsString()]);
Logger::error('Uncaught exception in worker execution', ['class' => get_class($e), 'message' => $e->getMessage(), 'code' => $e->getCode(), 'file' => $e->getFile() . ':' . $e->getLine(), 'trace' => $e->getTraceAsString(), 'previous' => $e->getPrevious()]);
Worker::defer();
}
} else {