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

    Interface IErrorDefinitionFinal<TData>

    Normalized runtime error-definition shape used internally by the helper implementation.

    interface IErrorDefinitionFinal<TData extends DefaultErrorType> {
        dataSchema?: IValidationSchema<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

    dataSchema?: IValidationSchema<TData>

    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.