plugin-error

  • Version 2.0.1
  • Published
  • 11.7 kB
  • 1 dependency
  • MIT license

Install

npm i plugin-error
yarn add plugin-error
pnpm add plugin-error

Overview

Error handling for Vinyl plugins.

Index

Variables

variable PluginError

const PluginError: PluginError.Constructor;

    Interfaces

    interface Constructor

    interface Constructor {}

      construct signature

      new <E extends Error>(
      plugin: string,
      error: E,
      options?: Options
      ): PluginError<E>;
      • Parameter plugin

        Plugin name

        Parameter error

        Base error

        Parameter options

        Error options

      construct signature

      new <E extends Error = Error>(
      plugin: string,
      error: E | string,
      options: Options
      ): PluginError<E | { [K in keyof E]: undefined }>;
      • Parameter plugin

        Plugin name

        Parameter error

        Base error or error message

        Parameter options

        Error options

      construct signature

      new <E extends Error = Error>(
      plugin: string,
      error: E | string | (Options & { message: string })
      ): PluginError<E | { [K in keyof E]: undefined }>;
      • Parameter plugin

        Plugin name

        Parameter error

        Base error, error message, or options with message

      construct signature

      new (options: Options & { plugin: string; message: string }): PluginError;
      • Parameter options

        Options with plugin name and message

      interface Options

      interface Options {}

        property fileName

        fileName?: string;
        • File name where the error occurred

        property lineNumber

        lineNumber?: number;
        • Line number where the error occurred

        property message

        message?: any;
        • Error message

        property name

        name?: string;
        • Error name

        property showProperties

        showProperties?: boolean;
        • Error properties will be included in err.toString(). Can be omitted by setting this to false.

          Default: true

        property showStack

        showStack?: boolean;
        • By default the stack will not be shown. Set this to true if you think the stack is important for your error.

          Default: false

        property stack

        stack?: string;
        • Error stack to use for err.toString() if showStack is true. By default it uses the stack of the original error if you used one, otherwise it captures a new stack.

        Type Aliases

        type PluginError

        type PluginError<T = {}> = PluginError.SimplePluginError & T;
        • Abstraction for error handling for Vinyl plugins

        Package Files (1)

        Dependencies (1)

        Dev Dependencies (7)

        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/plugin-error.

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