mirror of
https://github.com/kennethreitz/bake.git
synced 2026-06-05 23:00:17 +00:00
205 lines
12 KiB
Markdown
205 lines
12 KiB
Markdown
<!-- TITLE/ -->
|
|
|
|
<h1>errlop</h1>
|
|
|
|
<!-- /TITLE -->
|
|
|
|
|
|
<!-- BADGES/ -->
|
|
|
|
<span class="badge-travisci"><a href="http://travis-ci.org/bevry/errlop" title="Check this project's build status on TravisCI"><img src="https://img.shields.io/travis/bevry/errlop/master.svg" alt="Travis CI Build Status" /></a></span>
|
|
<span class="badge-npmversion"><a href="https://npmjs.org/package/errlop" title="View this project on NPM"><img src="https://img.shields.io/npm/v/errlop.svg" alt="NPM version" /></a></span>
|
|
<span class="badge-npmdownloads"><a href="https://npmjs.org/package/errlop" title="View this project on NPM"><img src="https://img.shields.io/npm/dm/errlop.svg" alt="NPM downloads" /></a></span>
|
|
<span class="badge-daviddm"><a href="https://david-dm.org/bevry/errlop" title="View the status of this project's dependencies on DavidDM"><img src="https://img.shields.io/david/bevry/errlop.svg" alt="Dependency Status" /></a></span>
|
|
<span class="badge-daviddmdev"><a href="https://david-dm.org/bevry/errlop#info=devDependencies" title="View the status of this project's development dependencies on DavidDM"><img src="https://img.shields.io/david/dev/bevry/errlop.svg" alt="Dev Dependency Status" /></a></span>
|
|
<br class="badge-separator" />
|
|
<span class="badge-patreon"><a href="https://patreon.com/bevry" title="Donate to this project using Patreon"><img src="https://img.shields.io/badge/patreon-donate-yellow.svg" alt="Patreon donate button" /></a></span>
|
|
<span class="badge-flattr"><a href="https://flattr.com/profile/balupton" title="Donate to this project using Flattr"><img src="https://img.shields.io/badge/flattr-donate-yellow.svg" alt="Flattr donate button" /></a></span>
|
|
<span class="badge-liberapay"><a href="https://liberapay.com/bevry" title="Donate to this project using Liberapay"><img src="https://img.shields.io/badge/liberapay-donate-yellow.svg" alt="Liberapay donate button" /></a></span>
|
|
<span class="badge-thanksapp"><a href="https://givethanks.app/donate/npm/errlop" title="Donate to this project using Thanks App"><img src="https://img.shields.io/badge/thanksapp-donate-yellow.svg" alt="Thanks App donate button" /></a></span>
|
|
<span class="badge-boostlab"><a href="https://boost-lab.app/bevry/errlop" title="Donate to this project using Boost Lab"><img src="https://img.shields.io/badge/boostlab-donate-yellow.svg" alt="Boost Lab donate button" /></a></span>
|
|
<span class="badge-buymeacoffee"><a href="https://buymeacoffee.com/balupton" title="Donate to this project using Buy Me A Coffee"><img src="https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg" alt="Buy Me A Coffee donate button" /></a></span>
|
|
<span class="badge-opencollective"><a href="https://opencollective.com/bevry" title="Donate to this project using Open Collective"><img src="https://img.shields.io/badge/open%20collective-donate-yellow.svg" alt="Open Collective donate button" /></a></span>
|
|
<span class="badge-crypto"><a href="https://bevry.me/crypto" title="Donate to this project using Cryptocurrency"><img src="https://img.shields.io/badge/crypto-donate-yellow.svg" alt="crypto donate button" /></a></span>
|
|
<span class="badge-paypal"><a href="https://bevry.me/paypal" title="Donate to this project using Paypal"><img src="https://img.shields.io/badge/paypal-donate-yellow.svg" alt="PayPal donate button" /></a></span>
|
|
<span class="badge-wishlist"><a href="https://bevry.me/wishlist" title="Buy an item on our wishlist for us"><img src="https://img.shields.io/badge/wishlist-donate-yellow.svg" alt="Wishlist browse button" /></a></span>
|
|
|
|
<!-- /BADGES -->
|
|
|
|
|
|
<!-- DESCRIPTION/ -->
|
|
|
|
An extended Error class that envelops a parent error, such that the stack trace contains the causation
|
|
|
|
<!-- /DESCRIPTION -->
|
|
|
|
|
|
<!-- INSTALL/ -->
|
|
|
|
<h2>Install</h2>
|
|
|
|
<a href="https://npmjs.com" title="npm is a package manager for javascript"><h3>npm</h3></a>
|
|
<ul>
|
|
<li>Install: <code>npm install --save errlop</code></li>
|
|
<li>Require: <code>require('errlop')</code></li>
|
|
</ul>
|
|
|
|
<a href="https://jspm.io" title="Native ES Modules CDN"><h3>jspm</h3></a>
|
|
|
|
``` html
|
|
<script type="module">
|
|
import * as pkg from '//dev.jspm.io/errlop'
|
|
</script>
|
|
```
|
|
|
|
<h3><a href="https://editions.bevry.me" title="Editions are the best way to produce and consume packages you care about.">Editions</a></h3>
|
|
|
|
<p>This package is published with the following editions:</p>
|
|
|
|
<ul><li><code>errlop</code> aliases <code>errlop/index.js</code> which uses <a href="https://editions.bevry.me" title="Editions are the best way to produce and consume packages you care about.">Editions</a> to automatically select the correct edition for the consumers environment</li>
|
|
<li><code>errlop/source/index.js</code> is esnext source code with require for modules</li>
|
|
<li><code>errlop/edition-browsers/index.js</code> is esnext compiled for browsers with require for modules</li>
|
|
<li><code>errlop/edition-node-0.8/index.js</code> is esnext compiled for node.js 0.8 with require for modules</li></ul>
|
|
|
|
<h3><a href="https://www.typescriptlang.org/" title="TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. ">TypeScript</a></h3>
|
|
|
|
This project provides its type information via inline <a href="http://usejsdoc.org" title="JSDoc is an API documentation generator for JavaScript, similar to Javadoc or phpDocumentor">JSDoc Comments</a>. To make use of this in <a href="https://www.typescriptlang.org/" title="TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. ">TypeScript</a>, set your <code>maxNodeModuleJsDepth</code> compiler option to `5` or thereabouts. You can accomlish this via your `tsconfig.json` file like so:
|
|
|
|
``` json
|
|
{
|
|
"compilerOptions": {
|
|
"maxNodeModuleJsDepth": 5
|
|
}
|
|
}
|
|
```
|
|
|
|
<!-- /INSTALL -->
|
|
|
|
|
|
## Usage
|
|
|
|
[Complete API Documentation.](http://master.errlop.bevry.surge.sh/docs/)
|
|
|
|
``` javascript
|
|
const Errlop = require('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)
|
|
*/
|
|
```
|
|
|
|
|
|
<!-- HISTORY/ -->
|
|
|
|
<h2>History</h2>
|
|
|
|
<a href="https://github.com/bevry/errlop/blob/master/HISTORY.md#files">Discover the release history by heading on over to the <code>HISTORY.md</code> file.</a>
|
|
|
|
<!-- /HISTORY -->
|
|
|
|
|
|
<!-- CONTRIBUTE/ -->
|
|
|
|
<h2>Contribute</h2>
|
|
|
|
<a href="https://github.com/bevry/errlop/blob/master/CONTRIBUTING.md#files">Discover how you can contribute by heading on over to the <code>CONTRIBUTING.md</code> file.</a>
|
|
|
|
<!-- /CONTRIBUTE -->
|
|
|
|
|
|
<!-- BACKERS/ -->
|
|
|
|
<h2>Backers</h2>
|
|
|
|
<h3>Maintainers</h3>
|
|
|
|
These amazing people are maintaining this project:
|
|
|
|
<ul><li><a href="http://balupton.com">Benjamin Lupton</a> — <a href="https://github.com/bevry/errlop/commits?author=balupton" title="View the GitHub contributions of Benjamin Lupton on repository bevry/errlop">view contributions</a></li></ul>
|
|
|
|
<h3>Sponsors</h3>
|
|
|
|
No sponsors yet! Will you be the first?
|
|
|
|
<span class="badge-patreon"><a href="https://patreon.com/bevry" title="Donate to this project using Patreon"><img src="https://img.shields.io/badge/patreon-donate-yellow.svg" alt="Patreon donate button" /></a></span>
|
|
<span class="badge-flattr"><a href="https://flattr.com/profile/balupton" title="Donate to this project using Flattr"><img src="https://img.shields.io/badge/flattr-donate-yellow.svg" alt="Flattr donate button" /></a></span>
|
|
<span class="badge-liberapay"><a href="https://liberapay.com/bevry" title="Donate to this project using Liberapay"><img src="https://img.shields.io/badge/liberapay-donate-yellow.svg" alt="Liberapay donate button" /></a></span>
|
|
<span class="badge-thanksapp"><a href="https://givethanks.app/donate/npm/errlop" title="Donate to this project using Thanks App"><img src="https://img.shields.io/badge/thanksapp-donate-yellow.svg" alt="Thanks App donate button" /></a></span>
|
|
<span class="badge-boostlab"><a href="https://boost-lab.app/bevry/errlop" title="Donate to this project using Boost Lab"><img src="https://img.shields.io/badge/boostlab-donate-yellow.svg" alt="Boost Lab donate button" /></a></span>
|
|
<span class="badge-buymeacoffee"><a href="https://buymeacoffee.com/balupton" title="Donate to this project using Buy Me A Coffee"><img src="https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg" alt="Buy Me A Coffee donate button" /></a></span>
|
|
<span class="badge-opencollective"><a href="https://opencollective.com/bevry" title="Donate to this project using Open Collective"><img src="https://img.shields.io/badge/open%20collective-donate-yellow.svg" alt="Open Collective donate button" /></a></span>
|
|
<span class="badge-crypto"><a href="https://bevry.me/crypto" title="Donate to this project using Cryptocurrency"><img src="https://img.shields.io/badge/crypto-donate-yellow.svg" alt="crypto donate button" /></a></span>
|
|
<span class="badge-paypal"><a href="https://bevry.me/paypal" title="Donate to this project using Paypal"><img src="https://img.shields.io/badge/paypal-donate-yellow.svg" alt="PayPal donate button" /></a></span>
|
|
<span class="badge-wishlist"><a href="https://bevry.me/wishlist" title="Buy an item on our wishlist for us"><img src="https://img.shields.io/badge/wishlist-donate-yellow.svg" alt="Wishlist browse button" /></a></span>
|
|
|
|
<h3>Contributors</h3>
|
|
|
|
These amazing people have contributed code to this project:
|
|
|
|
<ul><li><a href="http://balupton.com">Benjamin Lupton</a> — <a href="https://github.com/bevry/errlop/commits?author=balupton" title="View the GitHub contributions of Benjamin Lupton on repository bevry/errlop">view contributions</a></li></ul>
|
|
|
|
<a href="https://github.com/bevry/errlop/blob/master/CONTRIBUTING.md#files">Discover how you can contribute by heading on over to the <code>CONTRIBUTING.md</code> file.</a>
|
|
|
|
<!-- /BACKERS -->
|
|
|
|
|
|
<!-- LICENSE/ -->
|
|
|
|
<h2>License</h2>
|
|
|
|
Unless stated otherwise all works are:
|
|
|
|
<ul><li>Copyright © 2018+ Benjamin Lupton</li></ul>
|
|
|
|
and licensed under:
|
|
|
|
<ul><li><a href="http://spdx.org/licenses/MIT.html">MIT License</a></li></ul>
|
|
|
|
<!-- /LICENSE -->
|