TimeoutError.ts
This file
Path
source/errors/TimeoutError.ts
11 lines · 282 bytes · TypeScript
Last changed by
Use KyRequest and KyResponse types in errors (#610)Mark Fultonbefore adoption8e171f5
History of this fileTake it
Use KyRequest and KyResponse types in errors (#610)Mark Fultonbefore adoption8e171f5
lines 1–2why, one step back1import type {KyRequest} from '../types/request.js';2Move to TypeScript (#330)Olivier Louvignesbefore adoption2d8d68a
line 3why, one step back3export class TimeoutError extends Error {Use KyRequest and KyResponse types in errors (#610)Mark Fultonbefore adoption8e171f5
line 4why, one step back4 public request: KyRequest;Minor tweaksSindre Sorhusbefore adoption453846e
line 5why, one step back5Move to TypeScript (#330)Olivier Louvignesbefore adoption2d8d68a
line 6why, one step back6 constructor(request: Request) {Add request method and URL to error messages (#595)Seth Holladaybefore adoption36d0bd3
line 7why, one step back7 super(`Request timed out: ${request.method} ${request.url}`);Move to TypeScript (#330)Olivier Louvignesbefore adoption2d8d68a
lines 8–11why, one step back8 this.name = 'TimeoutError';9 this.request = request;10 }11}