UNPKG

@ne1410s/http

Version:

Lightweight ES5 script to provide http utilities

25 lines (24 loc) 825 B
import { IOperation } from '../operation/base'; import { Verb } from '../operation/http'; /** * Thrown when an operation was not invoked successfully. */ export declare class OperationInvocationError<TRequest, TResponse, TOperation extends IOperation<TRequest, TResponse>> extends Error { readonly message: string; readonly operation: TOperation; readonly request: TRequest; readonly cause?: any; constructor(message: string, operation: TOperation, request: TRequest, cause?: any); } /** * Thrown when an http response is deemed to be unworkable. */ export declare class HttpResponseError extends Error { readonly verb: Verb; body: string; headers: Record<string, string>; statusCode: number; statusText: string; url: string; constructor(response: Response, verb: Verb); }