Skip to content

Commit a3fe1fb

Browse files
committed
Pass exception to onException callback
1 parent 057d7b8 commit a3fe1fb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/graphql-server/src/createGraphQLYoga.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export const createGraphQLYoga = ({
202202
logger.fatal(e, '\n ⚠️ GraphQL server crashed \n')
203203

204204
if (onException) {
205-
onException()
205+
onException(e)
206206
}
207207

208208
// Forcefully crash the graphql server

packages/graphql-server/src/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export type GraphQLYogaOptions = {
132132
/**
133133
* @description A callback when an unhandled exception occurs. Use this to disconnect your prisma instance.
134134
*/
135-
onException?: () => void
135+
onException?: (e: unknown) => void
136136

137137
/**
138138
* @description Services passed from the glob import:

0 commit comments

Comments
 (0)