Skip to content

Commit 3f9e1d1

Browse files
committed
Fix error handling for safari
1 parent d08df6a commit 3f9e1d1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/types.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ export class ClientError extends Error {
4343
this.response = response
4444
this.request = request
4545

46-
Error.captureStackTrace(this, ClientError)
46+
// this is needed as Safari doesn't support .captureStackTrace
47+
if (typeof Error.captureStackTrace === 'function') {
48+
Error.captureStackTrace(this, ClientError)
49+
}
4750
}
4851

4952
private static extractMessage (response: GraphQLResponse): string {

0 commit comments

Comments
 (0)