The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Fix exception handler capturing graphql errors (#5714)
Weikoe2dc660d180d
diff --git a/packages/twenty-server/src/engine/utils/global-exception-handler.util.ts b/packages/twenty-server/src/engine/utils/global-exception-handler.util.tsindex 66878862ed6..326f991bb40 100644--- a/packages/twenty-server/src/engine/utils/global-exception-handler.util.ts+++ b/packages/twenty-server/src/engine/utils/global-exception-handler.util.ts@@ -1,5 +1,7 @@import { HttpException } from '@nestjs/common';+import { GraphQLError } from 'graphql';+import { ExceptionHandlerUser } from 'src/engine/integrations/exception-handler/interfaces/exception-handler-user.interface';import {@@ -35,6 +37,12 @@ export const handleExceptionAndConvertToGraphQLError = (};export const shouldFilterException = (exception: Error): boolean => {+ if (+ exception instanceof GraphQLError &&+ (exception?.extensions?.http?.status ?? 500) < 500+ ) {+ return true;+ }if (exception instanceof HttpException && exception.getStatus() < 500) {return true;}