@lgd-utils/error
Version:
A front-end error tool
63 lines (48 loc) • 3.07 kB
Markdown
<!--
* : shiconghua
* : LGD.HuaFEEng
* : 2021-09-19 22:59:53
* : 2021-11-18 15:16:59
* : shiconghua
* : file content
* : \lgd-utils\packages\error\README.md
-->
# `-utils/error`
<div align="center">
[](https://bundlephobia.com/result?p=@lgd-utils/error)
[](https://opensource.org/licenses/MIT/)
[](https://npmjs.org/package/@lgd-utils/error)
[](https://npmjs.org/package/@lgd-utils/error)
[](https://github.com/lodash/lodash)
[](https://www.npmjs.com/package/@lgd-utils/error)
[](https://github.com/prettier/prettier)
</div>
> A front-end error tool
## Usage
```
import error from '-utils/error';
const { CustomError } = error;
CustomError.isCustomError === true; // true
const customError = new CustomError('CustomError test', { key: 'value' })
customError.isCustomError === true; // true
console.log(customError.message); // 'CustomError test'
console.log(customError.key); // 'value'
```
## Contribute
- [LGD.HuaFEEng(LGD.HuaOPER)][blog]
## Documentation
- [Quick tutorial](https://github.com/LGDHuaOPER/lgd-utils/tree/main/packages/error#readme)
- [Issue](https://github.com/LGDHuaOPER/lgd-utils/issues)
## Related
- [-utils/array](https://github.com/LGDHuaOPER/lgd-utils/tree/main/packages/array) - A front-end array tool
- [-utils/axios](https://github.com/LGDHuaOPER/lgd-utils/tree/main/packages/axios) - A axios adapter and middleware tool
- [-utils/cached-storage](https://github.com/LGDHuaOPER/lgd-utils/tree/main/packages/cached-storage) - 一个具有失效功能的缓存存储库
- [-utils/html](https://github.com/LGDHuaOPER/lgd-utils/tree/main/packages/html) - A front-end html tool
- [-utils/number](https://github.com/LGDHuaOPER/lgd-utils/tree/main/packages/number) - A front-end number tool
- [-utils/object](https://github.com/LGDHuaOPER/lgd-utils/tree/main/packages/object) - A front-end object tool
- [-utils/regexp](https://github.com/LGDHuaOPER/lgd-utils/tree/main/packages/regexp) - A front-end regexp tool
- [-utils/symbol](https://github.com/LGDHuaOPER/lgd-utils/tree/main/packages/symbol) - A front-end symbol tool
- [-utils/utils](https://github.com/LGDHuaOPER/lgd-utils/tree/main/packages/utils) - A front-end utils tool
- [-utils/validate](https://github.com/LGDHuaOPER/lgd-utils/tree/main/packages/validate) - A front-end verification tool
- [More…](https://github.com/LGDHuaOPER/lgd-utils)
[blog]: https://lgdhuaoper.github.io/ '敬昭的博客'