From 865b12ba9dac5e16a0e6ee460b93b2f0d36bfdd3 Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Thu, 13 Jun 2024 09:24:51 +0100 Subject: [PATCH] chore: exception type --- app/controllers/api/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 900147398..5edfcc306 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -1525,7 +1525,7 @@ App::post('/v1/functions/:functionId/executions') ->action(function (string $functionId, string $body, bool $async, string $path, string $method, array $headers, ?string $scheduledAt, Response $response, Document $project, Database $dbForProject, Database $dbForConsole, Document $user, Event $queueForEvents, Usage $queueForUsage, Func $queueForFunctions, Reader $geodb) { if(!$async && !is_null($scheduledAt)) { - throw new Exception(Exception::GENERAL_QUERY_INVALID, 'Scheduled executions must run asynchronously. Don\'t set scheduledAt to execute immediately, or set async to true.'); + throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Scheduled executions must run asynchronously. Set scheduledAt to a future date, or set async to true.'); } $function = Authorization::skip(fn () => $dbForProject->getDocument('functions', $functionId));