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