Skip to content

Commit 204b71b

Browse files
committed
Avoid including createError in the stack trace
1 parent 3afb2f9 commit 204b71b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/provider.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,12 @@ export class FireblocksWeb3Provider extends HttpProvider {
266266
error.code = errorData.code || -32603
267267
error.data = errorData.data
268268
error.payload = errorData.payload
269+
270+
// We do this to avoid including this function in the stack trace
271+
if ((Error as any).captureStackTrace !== undefined) {
272+
(Error as any).captureStackTrace(error, this.createError);
273+
}
274+
269275
return error
270276
}
271277

0 commit comments

Comments
 (0)