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 fileTake 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 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';Add retry count to `afterResponse` and `beforeError` hooks (#763)Sindre Sorhusbefore adoption37fc250
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
line 7why, one step back7export class TimeoutError extends KyError {Allow customizing error names in TypeScriptSindre Sorhusbefore adoption52b8f93
line 8why, one step back8 override name = 'TimeoutError';Make `beforeError` hook receive all errors (#829)Sindre Sorhusbefore adoption101c74b
line 9why, one step back9 request: KyRequest;Add retry count to `afterResponse` and `beforeError` hooks (#763)Sindre Sorhusbefore adoption37fc250
lines 10–15why, one step back1011 constructor(request: Request) {12 super(`Request timed out: ${request.method} ${request.url}`);13 this.request = request;14 }15}