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
12345678910111213141516import type {KyRequest} from '../types/request.js';import {KyError} from './KyError.js';
/**Error thrown when the request times out. It has a `request` property with the `Request` object.*/export class TimeoutError extends KyError { override name = 'TimeoutError'; request: KyRequest;
constructor(request: Request) { super(`Request timed out: ${request.method} ${request.url}`); this.request = request; }}