TimeoutError.ts
This file
Path
source/errors/TimeoutError.ts
15 lines · 430 bytes · TypeScript
Last changed by
Readme tweaksSindre Sorhusbefore adoption7f2eade
History of this fileTake it
The walk stopped after 200 commits: lines older than a7204c4 point at it.
1.6.0Sindre Sorhusbefore adoptiona7204c4
line 1why, one step back1import type {KyRequest} from '../types/request.js';Make `beforeError` hook receive all errors (#829)Sindre Sorhusbefore adoption101c74b
line 2why, one step back2import {KyError} from './KyError.js';1.6.0Sindre Sorhusbefore adoptiona7204c4
line 3why, one step back3TweaksSindre Sorhusbefore adoption191057d
line 4why, one step back4/**Readme tweaksSindre Sorhusbefore adoption7f2eade
line 5why, one step back5Error thrown when the request times out. It has a `request` property with the `Request` object.TweaksSindre Sorhusbefore adoption191057d
line 6why, one step back6*/Make `beforeError` hook receive all errors (#829)Sindre Sorhusbefore adoption101c74b
lines 7–9why, one step back7export class TimeoutError extends KyError {8 override name = 'TimeoutError' as const;9 request: KyRequest;1.6.0Sindre Sorhusbefore adoptiona7204c4
lines 10–15why, one step back1011 constructor(request: Request) {12 super(`Request timed out: ${request.method} ${request.url}`);13 this.request = request;14 }15}