mnotify-ts-sdk
Version:
Modern, zero-dependency TypeScript SDK for mNotify BMS API - Type-safe SMS, contacts, and account management with Railway-Oriented Programming
28 lines (27 loc) • 1.05 kB
TypeScript
export interface MNotifyErrorContext {
service?: string;
operation?: string;
stage?: "request" | "validation" | "response" | "network";
method?: string;
path?: string;
url?: string;
retryCount?: number;
}
export declare class MNotifyError extends Error {
readonly statusCode: number;
readonly data?: unknown | undefined;
readonly context?: MNotifyErrorContext | undefined;
readonly cause?: unknown | undefined;
constructor(message: string, statusCode: number, data?: unknown | undefined, context?: MNotifyErrorContext | undefined, cause?: unknown | undefined);
withContext(context: MNotifyErrorContext): MNotifyError;
static fromUnknown(error: unknown, fallbackMessage: string, statusCode: number, context?: MNotifyErrorContext, data?: unknown): MNotifyError;
toJSON(): {
name: string;
message: string;
statusCode: number;
data: unknown;
context: MNotifyErrorContext | undefined;
cause: unknown;
stack: string | undefined;
};
}