Skip to content
This repository has been archived by the owner on Jan 24, 2025. It is now read-only.

Commit

Permalink
Mimic request-promise-native timeout error
Browse files Browse the repository at this point in the history
  • Loading branch information
id-ilych committed May 29, 2024
1 parent edfdd2c commit d3e0683
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/slack/src/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ async function request(method, { uri, headers, body, form, json, timeout }): Pro
return json ? response.json() : response
}
catch (err) {
if (err.name === 'AbortError') {
throw new FailedRequestError({code: 'ESOCKETTIMEDOUT', message: 'ESOCKETTIMEDOUT'})
}
throw new FailedRequestError(err)
}
}

0 comments on commit d3e0683

Please sign in to comment.