@ingeze/api-error - v1.0.8
    Preparing search index...

    Interface CreateHandleErrorOptions<TType, TDetails>

    Options for creating a custom error class.

    interface CreateHandleErrorOptions<
        TType extends string = string,
        TDetails extends Record<string, unknown> = Record<string, unknown>,
    > {
        defaultMessage?: string;
        defaultType: TType;
        name: string;
        statusCode: number;
    }

    Type Parameters

    • TType extends string = string

      A string literal type that defines specific error types (e.g. 'PAYMENT_FAILED').

    • TDetails extends Record<string, unknown> = Record<string, unknown>

      An object that describes additional details associated with the error.

    Index

    Properties

    defaultMessage?: string

    Optional default error message.

    defaultType: TType

    Default type identifier for the error (e.g. 'PAYMENT_FAILED').

    name: string

    The name of the custom error class (e.g. 'PaymentFailedError').

    statusCode: number

    Default HTTP status code to associate with the error (e.g. 400, 422).