chore: improve monitoring for fix(server): add MemorySize to Lambda executor fun

Changed the HTTP status code for `LOGIC_FUNCTION_EXECUTION_ERROR` from 500 to 422 in the route-trigger REST API exception filter.

Logic function execution errors are user code failures — a user's webhook handler crashing, running out of memory, or throwing an unhandled exception. These are expected operational behavior for a platform that runs user-provided code, not platform infrastructure failures.

Returning 500 caused `shouldCaptureException()` (which filters out errors with statusCode < 500) to report every user code failure to Sentry, creating monitoring noise that obscures actual platform bugs. With 422 (Unprocessable Entity), the error is still returned to the caller with the full error details and `LOGIC_FUNCTION_EXECUTION_ERROR` code in the response body, but it will no longer be captured by Sentry's exception handler.

The 422 status is semantically correct: the server understood the webhook request but the user's logic function could not process it successfully.
This commit is contained in:
Sonarly Claude Code 2026-04-10 12:25:02 +00:00
parent cb92f6ea42
commit e82aa6d7a6

View file

@ -43,7 +43,7 @@ export class RouteTriggerRestApiExceptionFilter implements ExceptionFilter {
return this.httpExceptionHandlerService.handleError(
exception as CustomException,
response,
500,
422,
);
case RouteTriggerExceptionCode.ROUTE_ALREADY_EXIST:
case RouteTriggerExceptionCode.ROUTE_PATH_ALREADY_EXIST: