From 6eafc6d5ef175505548620010fed3afb11050a45 Mon Sep 17 00:00:00 2001 From: Ly Tuan Kiet Date: Thu, 5 Dec 2024 22:47:26 +0700 Subject: [PATCH] fix: improve error handling in GraphQL connection parameters - Replaced error throws with logging for missing connection parameters in the GraphQL module. - Enhanced the logging mechanism to provide better insights during connection failures, improving overall debugging and monitoring capabilities. --- src/Graphql/graphql.module.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Graphql/graphql.module.ts b/src/Graphql/graphql.module.ts index 8fa5f38..d32e17c 100644 --- a/src/Graphql/graphql.module.ts +++ b/src/Graphql/graphql.module.ts @@ -109,10 +109,10 @@ import { PubSubService } from 'src/PubSub/pubsub.service' 'graphql-ws': { onConnect: (ctx: Context>) => { if (!ctx.connectionParams) { - throw new Error('No connectionParams provided') + Logger.log('No connectionParams provided', 'GraphqlModule') } if (!ctx.extra) { - throw new Error('No extra provided') + Logger.log('No extra provided', 'GraphqlModule') } // @ts-expect-error: Request is not typed ctx.extra.request.headers['x-session-id'] = ctx.connectionParams['x-session-id']