@openshift-console/dynamic-plugin-sdk
Version:
Provides core APIs, types and utilities used by dynamic plugins at runtime.
61 lines (60 loc) • 1.42 kB
TypeScript
import { CustomError } from './custom-error';
/**
* Http error
*
* Usage: throw HttpError.fromCode(404)
*/
export declare class HttpError extends CustomError {
code?: number;
response?: Response;
json?: any;
protected static messages: {
400: string;
401: string;
402: string;
403: string;
404: string;
405: string;
406: string;
407: string;
408: string;
409: string;
410: string;
411: string;
412: string;
413: string;
414: string;
415: string;
416: string;
417: string;
418: string;
421: string;
426: string;
428: string;
429: string;
431: string;
451: string;
500: string;
501: string;
502: string;
503: string;
504: string;
505: string;
506: string;
510: string;
511: string;
};
constructor(message: string, code?: number, response?: Response, json?: any);
static fromCode(code: number): HttpError;
}
export declare class TimeoutError extends CustomError {
url: string;
ms: number;
constructor(url: string, ms: number);
}
export declare class IncompleteDataError extends CustomError {
labels: string[];
constructor(labels: string[]);
}
export declare class RetryError extends CustomError {
}