Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nisaacson/build-error
Wrap error messages into a standard javascript error object
https://github.com/nisaacson/build-error
Last synced: about 1 month ago
JSON representation
Wrap error messages into a standard javascript error object
- Host: GitHub
- URL: https://github.com/nisaacson/build-error
- Owner: nisaacson
- Created: 2013-08-05T19:36:00.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-08-05T19:46:27.000Z (over 11 years ago)
- Last Synced: 2024-08-08T21:50:20.291Z (3 months ago)
- Language: JavaScript
- Size: 113 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Build Error
Wrap error messages into a javascript error object
# Installation
```bash
npm install -S build-error
```# Usage
```javascript
var buildError = require('build-error')
var errorMessage = 'Something blew up'
var source = 'invalid data supplied'
// meta is an optional object that will be added to the error object
var meta = {
foo: 'bar'
}
var error = buildError(errorMessage, source, meta)
console.dir(error)
```