Skip to content
Myr

TimeoutError.ts

This file

Path

source/errors/TimeoutError.ts

15 lines · 421 bytes · TypeScript

Last changed by

Allow customizing error names in TypeScriptSindre Sorhusbefore adoption52b8f93

History of this file

Take it

The walk stopped after 200 commits: lines older than 37fc250 point at it.

Add retry count to `afterResponse` and `beforeError` hooks (#763)Sindre Sorhusbefore adoption37fc250

line 1why, one step back
1import type {KyRequest} from '../types/request.js';

Make `beforeError` hook receive all errors (#829)Sindre Sorhusbefore adoption101c74b

line 2why, one step back
2import {KyError} from './KyError.js';

Add retry count to `afterResponse` and `beforeError` hooks (#763)Sindre Sorhusbefore adoption37fc250

line 3why, one step back
3

TweaksSindre Sorhusbefore adoption191057d

line 4why, one step back
4/**

Readme tweaksSindre Sorhusbefore adoption7f2eade

line 5why, one step back
5Error thrown when the request times out. It has a `request` property with the `Request` object.

TweaksSindre Sorhusbefore adoption191057d

line 6why, one step back
6*/

Make `beforeError` hook receive all errors (#829)Sindre Sorhusbefore adoption101c74b

line 7why, one step back
7export class TimeoutError extends KyError {

Allow customizing error names in TypeScriptSindre Sorhusbefore adoption52b8f93

line 8why, one step back
8 override name = 'TimeoutError';

Make `beforeError` hook receive all errors (#829)Sindre Sorhusbefore adoption101c74b

line 9why, one step back
9 request: KyRequest;

Add retry count to `afterResponse` and `beforeError` hooks (#763)Sindre Sorhusbefore adoption37fc250

lines 10–15why, one step back
10
11 constructor(request: Request) {12 super(`Request timed out: ${request.method} ${request.url}`);13 this.request = request;14 }15}