UNPKG

@telstra/core

Version:
28 lines (27 loc) 800 B
import { IErrorDetail } from '../../constants/ErrorConstants.js'; /** * The base class for all errors in the SDK. * * @remarks * This class provides a consistent structure for errors, * including a `code` property for machine-readable error identification * and a `formatError()` method for standardised error formatting. */ export declare class SDKError extends Error { /** * A machine-readable code for the error. */ code: number; /** * Creates a new `SDKError` instance. * * @param errorCode - The error code object containing the message and code. */ constructor(errorCode: IErrorDetail); /** * Formats the error for display. * * @returns A formatted string representation of the error. */ formatError(): string; }