morpheus-node
Version:
Official Node.js SDK for the Morpheus API Gateway - Connect to the Morpheus-Lumerin AI Marketplace
49 lines • 1.85 kB
TypeScript
/**
* Error handling for Morpheus Node SDK
*/
export declare class MorpheusError extends Error {
readonly status?: number;
readonly code?: string;
readonly type?: string;
readonly param?: string;
readonly details?: any;
constructor(message: string, status?: number, code?: string, type?: string, param?: string, details?: any);
static fromResponse(response: any, status?: number): MorpheusError;
}
export declare class MorpheusAPIError extends MorpheusError {
constructor(message: string, status: number, details?: any);
}
export declare class MorpheusAuthenticationError extends MorpheusError {
constructor(message?: string);
}
export declare class MorpheusPermissionError extends MorpheusError {
constructor(message?: string);
}
export declare class MorpheusNotFoundError extends MorpheusError {
constructor(resource: string);
}
export declare class MorpheusRateLimitError extends MorpheusError {
readonly retryAfter?: number;
constructor(message?: string, retryAfter?: number);
}
export declare class MorpheusValidationError extends MorpheusError {
constructor(message: string, param?: string);
}
export declare class MorpheusNetworkError extends MorpheusError {
constructor(message?: string, originalError?: Error);
}
export declare class MorpheusTimeoutError extends MorpheusError {
constructor(message?: string);
}
export declare class MorpheusStreamError extends MorpheusError {
constructor(message: string, details?: any);
}
/**
* Type guard to check if an error is a MorpheusError
*/
export declare function isMorpheusError(error: any): error is MorpheusError;
/**
* Helper to create appropriate error based on status code
*/
export declare function createErrorFromStatus(status: number, message: string, details?: any): MorpheusError;
//# sourceMappingURL=errors.d.ts.map