Skip to content

Commit

Permalink
Handle timeout error
Browse files Browse the repository at this point in the history
  • Loading branch information
szuperaz committed Nov 6, 2023
1 parent 91b07b6 commit f2a03b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/StreamClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ export class StreamClient {
},
onError: (context: ErrorContext) => {
const error = context.error as DOMException;
if (error.name === "AbortError") {
if (error.name === "AbortError" || error.name === "TimeoutError") {
throw new FetchError(
error,
`The request was aborted due to to the ${this.options.timeout}ms timeout, you can set the timeout in the StreamClient constructor`
Expand Down

0 comments on commit f2a03b2

Please sign in to comment.