Skip to content
Myr

TimeoutError.ts

This file

Path

source/errors/TimeoutError.ts

12 lines · 327 bytes · TypeScript

Last changed by

Make `beforeError` hook receive all errors (#829)Sindre Sorhusbefore adoption101c74b

History of this file

Take it

The walk stopped after 200 commits: lines older than d00864f point at it.

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

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

Make `beforeError` hook receive all errors (#829)Sindre Sorhusbefore adoption101c74b

line 2why, one step back
2import {KyError} from './KyError.js';

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

line 3why, one step back
3

Make `beforeError` hook receive all errors (#829)Sindre Sorhusbefore adoption101c74b

lines 4–6why, one step back
4export class TimeoutError extends KyError {
5 override name = 'TimeoutError' as const;6 request: KyRequest;

Allow overriding `Content-Type` header for JSON requests (#429)Seth Holladaybefore adoptiond00864f

lines 7–8why, one step back
7
8 constructor(request: Request) {

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

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

Allow overriding `Content-Type` header for JSON requests (#429)Seth Holladaybefore adoptiond00864f

lines 10–12why, one step back
10 this.request = request;
11 }12}