@chickenjdk/common
    Preparing search index...

    Variable createClassifyedErrorConst

    createClassifyedError: <
        reason extends string,
        isFatal extends boolean = true,
        oldError extends
            new (...args: [message?: string]) => InstanceType<oldError> = ErrorConstructor,
    >(
        reason: reason,
        oldError?: oldError,
        isFatal?: isFatal,
    ) => NoFunc<oldError> & new (
        ...args: ConstructorParameters<oldError>,
    ) => Omit<InstanceType<oldError>, "isFatal"> & {
        isFatal: isFatal;
        reasonChain: string[];
    } = createClassifiedError

    Type declaration

      • <
            reason extends string,
            isFatal extends boolean = true,
            oldError extends
                new (...args: [message?: string]) => InstanceType<oldError> = ErrorConstructor,
        >(
            reason: reason,
            oldError?: oldError,
            isFatal?: isFatal,
        ): NoFunc<oldError> & new (
            ...args: ConstructorParameters<oldError>,
        ) => Omit<InstanceType<oldError>, "isFatal"> & {
            isFatal: isFatal;
            reasonChain: string[];
        }
      • Create a classified error class that extends the oldError to add fancy classification prepended text and adds the reasonChain and isFatal properties.

        Type Parameters

        • reason extends string

          The error reason

        • isFatal extends boolean = true

          If the error is fatal. Defaults to true.

        • oldError extends new (...args: [message?: string]) => InstanceType<oldError> = ErrorConstructor

          The old error class to extend. Defaults to Error.

        Parameters

        Returns NoFunc<oldError> & new (
            ...args: ConstructorParameters<oldError>,
        ) => Omit<InstanceType<oldError>, "isFatal"> & {
            isFatal: isFatal;
            reasonChain: string[];
        }

        The new error class that extends the oldError with the reasonChain and isFatal properties.

    Use createClassifiedError instead. Removal scheduled for v3, as it is misspelled.