Clean workflow query invalid input errors from sentry (#18804)
As title
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
import { assertUnreachable } from 'twenty-shared/utils';
|
||||
|
||||
import { ForbiddenError } from 'src/engine/core-modules/graphql/utils/graphql-errors.util';
|
||||
import {
|
||||
type WorkflowQueryValidationException,
|
||||
WorkflowQueryValidationExceptionCode,
|
||||
} from 'src/modules/workflow/common/exceptions/workflow-query-validation.exception';
|
||||
|
||||
export const workflowQueryValidationGraphqlApiExceptionHandler = (
|
||||
exception: WorkflowQueryValidationException,
|
||||
) => {
|
||||
switch (exception.code) {
|
||||
case WorkflowQueryValidationExceptionCode.FORBIDDEN:
|
||||
throw new ForbiddenError(exception);
|
||||
default: {
|
||||
assertUnreachable(exception.code);
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user