Skip to content

Commit

Permalink
feat: add error cause to ServiceError
Browse files Browse the repository at this point in the history
closes #2
  • Loading branch information
schettn authored Jul 4, 2024
1 parent 061cc01 commit 6f2fbc9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/pylon/src/define-pylon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,13 @@ export class ServiceError extends GraphQLError {
code: string
statusCode: number
details?: Record<string, any>
}
},
error?: Error
) {
super(message)
super(message, {
originalError: error
})
this.extensions = extensions
this.cause = error
}
}

0 comments on commit 6f2fbc9

Please sign in to comment.