UNPKG

haravan-client

Version:
49 lines (48 loc) 1.66 kB
export declare enum ErrorCode { ServerError = 500, AlreadyExistsError = 422, PermissionDeniedError = 403, NotFoundError = 404, UnauthorizedError = 401, ValidationError = 400 } export declare enum ErrorMessage { ServerError = "Server Error", AlreadyExistsError = "Already Exists Error", PermissionDeniedError = "Permission Denied Error", NotFoundError = "Not Found Error", UnauthorizedError = "Unauthorized Error", ValidationError = "Validation Error" } export interface ErrorDetails { platform?: string; code?: number; message?: string; fields?: string[]; } export declare class AppError extends Error { code: number; details?: ErrorDetails; constructor(code: number, message: string, details?: ErrorDetails); } export declare class ServerError extends AppError { constructor(message?: string, details?: ErrorDetails); } export declare class HaravanError extends ServerError { constructor(message?: string, details?: ErrorDetails); } export declare class HaravanInvalidArgError extends ServerError { constructor(message?: string, details?: ErrorDetails); } export declare class HaravanUnauthorizedError extends ServerError { constructor(message?: string, details?: ErrorDetails); } export declare class HaravanNotFoundError extends ServerError { constructor(message?: string, details?: ErrorDetails); } export declare class HaravanAlreadyExistsError extends ServerError { constructor(message?: string, details?: ErrorDetails); } export declare class HaravanPermissionDeniedError extends ServerError { constructor(message?: string, details?: ErrorDetails); }