https://github.com/mhio/js-exception
Exceptions for Javascript ES2015+
https://github.com/mhio/js-exception
error-handling errors exceptions javascript nodejs
Last synced: 2 months ago
JSON representation
Exceptions for Javascript ES2015+
- Host: GitHub
- URL: https://github.com/mhio/js-exception
- Owner: mhio
- License: mit
- Created: 2018-03-09T21:13:26.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-04T13:26:27.000Z (over 2 years ago)
- Last Synced: 2025-03-18T04:58:08.282Z (3 months ago)
- Topics: error-handling, errors, exceptions, javascript, nodejs
- Language: JavaScript
- Homepage:
- Size: 526 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Exception - [@mhio/exception](http://npmjs.com/package/@mhio/exception)
----------ES2015+ Exception class extending Error
## Install
```
yarn add @mhio/exception
npm install @mhio/exception
```## Usage
[API Docs](doc/API.md)
```
import { Exception } from '@mhio/exception'class MyException extends Exception {
constructor( message, options = {} ){
super(message, options)
this.myprop = options.myprop
}
}throw new MyException('Normal error message', { simple: 'Set a simple message', label: 'UI Label', myprop: 13 })
```## Links
- Github - [mhio/node-exception](https://github.com/mhio/js-exception)
- npm - [@mhio/exception](https://www.npmjs.com/package/@mhio/exception)