Skip to content
Myr

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 file

Take it

Use KyRequest and KyResponse types in errors (#610)Mark Fultonbefore adoption8e171f5

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

Move to TypeScript (#330)Olivier Louvignesbefore adoption2d8d68a

line 3why, one step back
3export class TimeoutError extends Error {

Use KyRequest and KyResponse types in errors (#610)Mark Fultonbefore adoption8e171f5

line 4why, one step back
4 public request: KyRequest;

Minor tweaksSindre Sorhusbefore adoption453846e

line 5why, one step back
5

Move to TypeScript (#330)Olivier Louvignesbefore adoption2d8d68a

line 6why, one step back
6 constructor(request: Request) {

Add request method and URL to error messages (#595)Seth Holladaybefore adoption36d0bd3

line 7why, one step back
7 super(`Request timed out: ${request.method} ${request.url}`);

Move to TypeScript (#330)Olivier Louvignesbefore adoption2d8d68a

lines 8–11why, one step back
8 this.name = 'TimeoutError';
9 this.request = request;10 }11}