@bluelibs/runner - v6.3.1
    Preparing search index...

    Interface IErrorDefinition<TData>

    Declarative error-definition contract.

    interface IErrorDefinition<TData extends DefaultErrorType = DefaultErrorType> {
        dataSchema?: ValidationSchemaInput<TData>;
        format?: (data: TData) => string;
        httpCode?: number;
        id: string;
        meta?: IErrorMeta;
        parse?: (data: string) => TData;
        remediation?: string | ((data: TData) => string);
        serialize?: (data: TData) => string;
        tags?: ErrorTagType[];
    }

    Type Parameters

    Hierarchy (View Summary)

    Index

    Properties

    Validate error data on throw(). If provided, data is parsed first.

    format?: (data: TData) => string

    Formats the human-readable error message from typed data.

    httpCode?: number

    Optional HTTP status associated with this error.

    id: string

    Stable error identifier.

    meta?: IErrorMeta

    Optional metadata used by docs and tooling.

    parse?: (data: string) => TData

    Custom parser paired with serialize.

    remediation?: string | ((data: TData) => string)

    Optional advice on how to fix the error. Appears in the stringified error message after the main message. Can be a static string or a function that receives the error data and returns a string.

    serialize?: (data: TData) => string

    Custom serializer for transport or persistence scenarios.

    tags?: ErrorTagType[]

    Tags attached to the error helper.