errlop

  • Version 8.4.0
  • Published
  • 82.6 kB
  • 1 dependency
  • Artistic-2.0 license

Install

npm i errlop
yarn add errlop
pnpm add errlop

Overview

An extended Error class that envelops a parent error, such that the stack trace contains the causation

Index

Classes

class Errlop

class Errlop extends Error implements ErrorProperties {}
  • Errlop, an extended Error class that envelops a parent Error to provide ancestry stack inforation.

constructor

constructor(input: any, parent?: any);
  • Turn the input and parent into an Errlop instance.

property ancestors

ancestors: ErrorValid[];

    property code

    code: string | number;

      property exitCode

      exitCode: number;

        property klass

        klass: typeof Errlop;
        • Duck typing so native classes can work with transpiled classes, as otherwise they would fail instanceof checks.

        property level

        level: string | number;

          property message

          message: string;

            property orphanStack

            orphanStack: string;

              property parent

              parent: ErrorValid;

                property stack

                stack: string;

                  property stackSeparator

                  static stackSeparator: string;
                  • The separator to use for the stack entries

                  method create

                  static create: (input: ErrorInput, parent?: ErrorInput) => Errlop;
                  • Syntactic sugar for Errlop class creation. Enables Errlop.create(...) to achieve new Errlop(...)

                  method ensure

                  static ensure: (value: ErrorInput) => Errlop;
                  • Ensure that the value is an Errlop instance

                  method isErrlop

                  static isErrlop: { (value: Errlop): true; (value?: any): value is Errlop };
                  • Check whether or not the value is an Errlop instance

                  method isError

                  static isError: {
                  (value: ErrorValid): true;
                  (value?: any): value is ErrorValid;
                  };
                  • Check whether or not the value is an Errlop or Error instance.

                  Interfaces

                  interface ErrorProperties

                  interface ErrorProperties {}

                  property ancestors

                  ancestors: Array<ErrorValid>;
                  • An array of the parent lineage. Most immediate to most distant.

                  property code

                  code: string | number;
                  • The code to identify this error. If a string code, it will be included in the stack.

                  property exitCode

                  exitCode: number | null;
                  • A numeric code that can be used for the process exit status. If not provided, inherited from ancestors exitCode, errno, code numeric properties.

                  property level

                  level: string | number;
                  • The severity level of this error.

                  property message

                  message: string;
                  • The description of this error.

                  property orphanStack

                  orphanStack: string;
                  • The stack of this error alone, without any ancestry.

                  property parent

                  parent: ErrorValid | null;
                  • The parent that caused this error, if any. If not provided, inherited from cause property.

                  property stack

                  stack: string;
                  • The stack of this error including its ancestry.

                  Type Aliases

                  type ErrorInput

                  type ErrorInput = Errlop | Error | Partial<ErrorProperties> | string | any;
                  • An input that can become an Errlop or Error instance.

                  type ErrorValid

                  type ErrorValid = Errlop | Error;
                  • A valid Errlop or Error instance.

                  Package Files (1)

                  Dependencies (1)

                  Dev Dependencies (16)

                  Peer Dependencies (0)

                  No peer dependencies.

                  Badge

                  To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                  You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/errlop.

                  • Markdown
                    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/errlop)
                  • HTML
                    <a href="https://www.jsdocs.io/package/errlop"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>