@aws-amplify/core
Version:
Core category of aws-amplify
24 lines (23 loc) • 769 B
TypeScript
export declare enum AmplifyErrorCode {
NoEndpointId = "NoEndpointId",
PlatformNotSupported = "PlatformNotSupported",
Unknown = "Unknown",
NetworkError = "NetworkError"
}
export interface AmplifyErrorParams<ErrorCode extends string = string> {
message: string;
name: ErrorCode;
recoverySuggestion?: string;
underlyingError?: Error | unknown;
}
export type AmplifyErrorMap<ErrorCode extends string = string> = {
[name in ErrorCode]: {
message: string;
recoverySuggestion?: string;
};
};
export interface ServiceError {
name: string;
message: string;
}
export type AssertionFunction<ErrorCode extends string = string> = (assertion: boolean, name: ErrorCode, additionalContext?: string) => asserts assertion;