@roochnetwork/rooch-sdk
Version:
23 lines (22 loc) • 1.37 kB
TypeScript
export declare enum ErrorCategory {
INVALID_ARGUMENT = 1,// Caller specified an invalid argument (http: 400)
OUT_OF_RANGE = 2,// An input or result of a computation is out of range (http: 400)
INVALID_STATE = 3,// The system is not in a state where the operation can be performed (http: 400)
UNAUTHENTICATED = 4,// Request not authenticated due to missing, invalid, or expired auth token (http: 401)
PERMISSION_DENIED = 5,// client does not have sufficient permission (http: 403)
NOT_FOUND = 6,// A specified resource is not found (http: 404)
ABORTED = 7,// Concurrency conflict, such as read-modify-write conflict (http: 409)
ALREADY_EXISTS = 8,// The resource that a client tried to create already exists (http: 409)
RESOURCE_EXHAUSTED = 9,// Out of gas or other forms of quota (http: 429)
CANCELLED = 10,// Request cancelled by the client (http: 499)
INTERNAL = 11,// Internal error (http: 500)
NOT_IMPLEMENTED = 12,// Feature not implemented (http: 501)
UNAVAILABLE = 13
}
export interface SubStatus {
category: ErrorCategory;
reason: number;
}
export declare function parseRoochErrorCode(errorMessage: string | null): number | null;
export declare function parseRoochErrorSubStatus(errorMessage: string | null): SubStatus | null;
export declare function getErrorCategoryName(code: ErrorCategory): string;