Skip to content

Commit

Permalink
fix: pass source Interceptor
Browse files Browse the repository at this point in the history
  • Loading branch information
arlac77 committed Feb 9, 2024
1 parent 3b9881c commit 438f68a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/timeout-interceptor.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ export class TimeoutInterceptor extends Interceptor {
* Rejects promise when it is not resolved within given timeout.
* @param {Promise} promise
* @param {number} timeout in miliseconds
* @param {string} name
* @param {Interceptor} source
* @return {Promise<any>}
*/
function rejectUnlessResolvedWithin(promise, timeout, name) {
function rejectUnlessResolvedWithin(promise, timeout, source) {
if (timeout === 0) return promise;

return new Promise((resolve, reject) => {
const th = setTimeout(
() =>
reject(new Error(`${name} request not resolved within ${timeout}ms`)),
reject(new Error(`${source} request not resolved within ${timeout}ms`)),
timeout
);

Expand Down

0 comments on commit 438f68a

Please sign in to comment.