Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/gavinning/shareerror

创建携带更多信息的Error对象
https://github.com/gavinning/shareerror

err-code error error-code share-error shareerror

Last synced: about 2 months ago
JSON representation

创建携带更多信息的Error对象

Awesome Lists containing this project

README

        

ShareError
---
可以携带err-code的Error对象

### Install
```sh
npm i @4a/share-error
```

### Usage
```js
const ShareError = require('@4a/share-error')

throw new ShareError(100, 'error code is 100')
throw new ShareError(200, 'error code is 200')
throw new ShareError(300, 'error code is 300')
```