Skip to content
Myr

TimeoutError.ts

This file

Path

source/errors/TimeoutError.ts

15 lines · 430 bytes · TypeScript

Last changed by

Readme tweaksSindre Sorhusbefore adoption7f2eade

History of this file

Take it

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

1.6.0Sindre Sorhusbefore adoptiona7204c4

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';

1.6.0Sindre Sorhusbefore adoptiona7204c4

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

lines 7–9why, one step back
7export class TimeoutError extends KyError {
8 override name = 'TimeoutError' as const;9 request: KyRequest;

1.6.0Sindre Sorhusbefore adoptiona7204c4

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}