UNPKG

927 BTypeScriptView Raw
1import type { RequestOptions, ResponseHeaders, OctokitResponse } from "@octokit/types";
2import type { RequestErrorOptions } from "./types";
3/**
4 * Error with extra properties to help with debugging
5 */
6export declare class RequestError extends Error {
7 name: "HttpError";
8 /**
9 * http status code
10 */
11 status: number;
12 /**
13 * http status code
14 *
15 * @deprecated `error.code` is deprecated in favor of `error.status`
16 */
17 code: number;
18 /**
19 * Request options that lead to the error.
20 */
21 request: RequestOptions;
22 /**
23 * error response headers
24 *
25 * @deprecated `error.headers` is deprecated in favor of `error.response.headers`
26 */
27 headers: ResponseHeaders;
28 /**
29 * Response object if a response was received
30 */
31 response?: OctokitResponse<unknown>;
32 constructor(message: string, statusCode: number, options: RequestErrorOptions);
33}