Improve logs
This commit is contained in:
parent
0368cdb669
commit
1762c4f491
1 changed files with 9 additions and 0 deletions
|
@ -40,6 +40,8 @@ Server::setResource('execute', function () {
|
|||
string $eventData = null,
|
||||
string $executionId = null,
|
||||
) {
|
||||
$error = null; // Used to re-throw at the end to trigger Logger (Sentry)
|
||||
|
||||
$user ??= new Document();
|
||||
$functionId = $function->getId();
|
||||
$deploymentId = $function->getAttribute('deployment', '');
|
||||
|
@ -157,6 +159,8 @@ Server::setResource('execute', function () {
|
|||
Console::error($th->getFile());
|
||||
Console::error($th->getLine());
|
||||
Console::error($th->getMessage());
|
||||
|
||||
$error = $th->getMessage();
|
||||
}
|
||||
|
||||
$execution = $dbForProject->updateDocument('executions', $executionId, $execution);
|
||||
|
@ -217,6 +221,11 @@ Server::setResource('execute', function () {
|
|||
->setParam('networkResponseSize', 0)
|
||||
->submit();
|
||||
}
|
||||
|
||||
if(!empty($error)) {
|
||||
$projectId = $project->getId();
|
||||
throw new Exception("Error in project #{$projectId}, function #{$functionId}: " . $error);
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue