We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents cb5c85a + 95571ed commit b41ac43Copy full SHA for b41ac43
1 file changed
src/index.ts
@@ -629,7 +629,16 @@ export async function call<Output = unknown>(
629
)
630
: ping(endpoint, opts.ping, opts.ipv6, opts.signal));
631
} catch (error) {
632
- throw error instanceof ProcedureTimedOutError
+ const isTimeoutError = (error: unknown): boolean =>
633
+ error instanceof ProcedureTimedOutError ||
634
+ (error instanceof AggregateError &&
635
+ error.errors.every(
636
+ (e) =>
637
+ e instanceof ProcedureTimedOutError ||
638
+ isTimeoutError(e)
639
+ ));
640
+ if (!isTimeoutError(error)) console.debug(error);
641
+ throw isTimeoutError(error)
642
? new ProcedureNotFoundError() // timeout on ping = not found
643
: error;
644
}
0 commit comments