@aws-amplify/core
Version:
Core category of aws-amplify
31 lines (30 loc) • 903 B
TypeScript
import { AmplifyErrorParams } from '../types/errors';
import { AmplifyError } from './AmplifyError';
/**
* The type of an unwrapped HTTP response causing the given API error.
* @internal
*/
export interface ApiErrorResponse {
statusCode: number;
headers: Record<string, string>;
body?: string;
}
/**
* The constructor parameters for an API error.
* @internal
*/
export interface ApiErrorParams extends AmplifyErrorParams {
response?: ApiErrorResponse;
}
/**
* Error class for errors that associated with unsuccessful HTTP responses.
* It's throw by API category REST API handlers and GraphQL query handlers for now.
*/
export declare class ApiError extends AmplifyError {
private readonly _response?;
/**
* The unwrapped HTTP response causing the given API error.
*/
get response(): ApiErrorResponse | undefined;
constructor(params: ApiErrorParams);
}