Detalhes do pacote

errlop

bevry3.1mArtistic-2.08.4.0

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

browser, deno, deno-edition, deno-entry

readme (leia-me)

errlop

Status of the GitHub Workflow: bevry NPM version NPM downloads
GitHub Sponsors donate button ThanksDev donate button Patreon donate button Liberapay donate button Buy Me A Coffee donate button Open Collective donate button crypto donate button PayPal donate button
Discord server badge Twitch community badge

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

Usage

Complete API Documentation.

// const Errlop = require('errlop').default
import Errlop from 'errlop'
const a = new Errlop('AError')
const b = new Errlop('BError', a)
const c = Errlop.create('CError', b)
console.log(c.stack)
/*
Error: CError
    at Function.create (/Users/balupton/Projects/active/errlop/source/index.js:92:10)
    at Object.<anonymous> (/Users/balupton/Projects/active/errlop/example.js:6:18)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at startup (internal/bootstrap/node.js:266:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:596:3)
↳ Error: BError
    at Object.<anonymous> (/Users/balupton/Projects/active/errlop/example.js:5:11)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at startup (internal/bootstrap/node.js:266:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:596:3)
↳ Error: AError
    at Object.<anonymous> (/Users/balupton/Projects/active/errlop/example.js:4:11)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at startup (internal/bootstrap/node.js:266:19)
*/
console.log(c.orphanStack)
/*
Error: CError
    at Function.create (/Users/balupton/Projects/active/errlop/source/index.js:92:10)
    at Object.<anonymous> (/Users/balupton/Projects/active/errlop/example.js:6:18)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at startup (internal/bootstrap/node.js:266:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:596:3)
*/

Install

npm

  • Install: npm install --save errlop
  • Import: import pkg from ('errlop')
  • Require: const pkg = require('errlop').default

Deno

import pkg from 'https://unpkg.com/errlop@^8.4.0/edition-deno/index.ts'

Skypack

<script type="module">
    import pkg from '//cdn.skypack.dev/errlop@^8.4.0'
</script>

unpkg

<script type="module">
    import pkg from '//unpkg.com/errlop@^8.4.0'
</script>

jspm

<script type="module">
    import pkg from '//dev.jspm.io/errlop@8.4.0'
</script>

Editions

This package is published with the following editions:

  • errlop aliases errlop/index.cjs which uses the Editions Autoloader to automatically select the correct edition for the consumer's environment
  • errlop/source/index.ts is TypeScript source code with Import for modules
  • errlop/edition-browsers/index.js is TypeScript compiled against ES2022 for web browsers with Import for modules
  • errlop/edition-es2022/index.js is TypeScript compiled against ES2022 for Node.js 14 || 16 || 18 || 20 || 21 with Require for modules
  • errlop/edition-es2017/index.js is TypeScript compiled against ES2017 for Node.js 6 || 8 || 10 || 12 || 14 || 16 || 18 || 20 || 21 with Require for modules
  • errlop/edition-es5/index.js is TypeScript compiled against ES5 for Node.js 4 || 6 || 8 || 10 || 12 || 14 || 16 || 18 || 20 || 21 with Require for modules
  • errlop/edition-es2017-esm/index.js is TypeScript compiled against ES2017 for Node.js 12 || 14 || 16 || 18 || 20 || 21 with Import for modules
  • errlop/edition-types/index.d.ts is TypeScript compiled Types with Import for modules
  • errlop/edition-deno/index.ts is TypeScript source code made to be compatible with Deno

History

Discover the release history by heading on over to the HISTORY.md file.

Backers

Code

Discover how to contribute via the CONTRIBUTING.md file.

Authors

Maintainers

Contributors

Finances

GitHub Sponsors donate button ThanksDev donate button Patreon donate button Liberapay donate button Buy Me A Coffee donate button Open Collective donate button crypto donate button PayPal donate button

Sponsors

  • Andrew Nesbitt — Software engineer and researcher
  • Balsa — We're Balsa, and we're building tools for builders.
  • Codecov — Empower developers with tools to improve code quality and testing.
  • Poonacha Medappa
  • Rob Morris
  • Sentry — Real-time crash reporting for your web apps, mobile apps, and games.
  • Syntax — Syntax Podcast

Donors

License

Unless stated otherwise all works are:

and licensed under:

changelog (log de mudanças)

History

v8.4.0 2023 December 28

v8.3.0 2023 December 27

v8.2.0 2023 December 5

v8.1.0 2023 December 5

v8.0.0 2023 November 30

  • Errlop now supports any input for itself and its parent, including objects with message, exitCode, code, level, etc properties. Parents that are not an Errlop or Error instance will become an Errlop instance.
  • isErrlop and the new isError static methods now conform to type predicates, this enables typed conditional filtering.
  • Updated dependencies, base files, and editions using boundation

v7.5.0 2023 November 29

v7.4.0 2023 November 24

v7.3.0 2023 November 21

v7.2.0 2023 November 14

v7.1.0 2023 November 13

v7.0.0 2023 November 13

  • Updated dependencies, base files, and editions using boundation
  • Minimum required Node.js version changed from node: >=6 to node: >=4 adapting to ecosystem changes

v6.0.0 2023 November 13

  • Updated dependencies, base files, and editions using boundation
  • Minimum required Node.js version changed from node: >=8 to node: >=6 adapting to ecosystem changes

v5.0.0 2023 November 13

  • Updated dependencies, base files, and editions using boundation
  • Minimum required Node.js version changed from node: >=4 to node: >=8 adapting to ecosystem changes

v4.6.0 2023 November 1

v4.5.0 2021 July 30

v4.4.0 2021 July 29

v4.3.0 2021 July 28

v4.2.0 2021 June 14

v4.1.0 2020 October 29

v4.0.0 2020 October 27

  • Changed engines from Node.js >=0.8 to >=4, as supporting versions that we cannot test against is too fragile
    • We are still generating the same code, using the ES5 compile target, so perhaps it still works, however we cannot and will not guarantee compatibility for Node.js versions earlier than v4
  • Updated dependencies, base files, and editions using boundation

v3.17.0 2020 September 4

v3.16.0 2020 August 18

v3.15.0 2020 August 4

v3.14.0 2020 July 22

v3.13.0 2020 July 22

v3.12.0 2020 July 21

v3.11.0 2020 July 3

v3.10.0 2020 June 25

v3.9.0 2020 June 21

v3.8.0 2020 June 21

v3.7.0 2020 June 20

v3.6.0 2020 June 10

v3.5.0 2020 June 10

  • Support null for the parent argument to make programatic usage of Errlop easier
  • Updated dependencies, base files, and editions using boundation

v3.4.0 2020 June 10

v3.3.0 2020 May 22

v3.2.0 2020 May 21

v3.1.0 2020 May 21

v3.0.0 2020 May 13

  • Support node >= 0.8 but test only against node >= 10
    • We are still generating the same code, using ES5 compile target, so support remains the same
    • However, testing ecosystem have been upgrading to node >= 10, as such unless all testing packages also function on node >= 0.8, which is possible but highly inconvenient then tests cannot run on such versions
  • Updated dependencies, base files, and editions using boundation

v2.2.0 2020 May 4

v2.1.0 2020 March 26

v2.0.0 2019 December 11

  • Errlop is now written in TypeScript
  • Errlop's browser edition now makes use of ECMAScript modules
  • Errlop now only includes one Node.js edition that runs on all Node.js environments
  • Updated dependencies, base files, and editions using boundation

v1.7.0 2019 December 9

v1.6.0 2019 December 1

v1.5.0 2019 December 1

v1.4.0 2019 December 1

v1.3.0 2019 November 18

v1.2.0 2019 November 13

v1.1.2 2019 September 10

v1.1.1 2018 December 28

  • Updated editions dependency, should function to fix issue #2

v1.1.0 2018 December 28

v1.0.3 2018 August 19

  • Add duck typing for Node.js v4 and under
  • Prevent additional crashes on Node.js v4

v1.0.2 2018 July 27

  • More efficient Node.js v4 crash prevention

v1.0.1 2018 July 27

  • Support Node.js v0.8
  • Prevent a peculiar crash on Node.js v4

v1.0.0 2018 July 21

  • Initial working release