Skip to content

Commit

Permalink
fix(RequestError): set toStringTag Error
Browse files Browse the repository at this point in the history
  • Loading branch information
rexerwang committed Jun 18, 2023
1 parent 3194450 commit a0a6642
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/shared/RequestError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ export class RequestError extends Error {
}

get [Symbol.toStringTag]() {
return 'RequestError'
return 'Error'
}
}
2 changes: 1 addition & 1 deletion src/shared/__tests__/RequestError.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ describe('RequestError specs', () => {
it('should return [object RequestError] when called with Object.prototype.toString', () => {
expect(
Object.prototype.toString.call(new RequestError('test', toAny({})))
).toBe('[object RequestError]')
).toBe('[object Error]')
})
})

0 comments on commit a0a6642

Please sign in to comment.