@4a/share-error

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

Usage no npm install needed!

<script type="module">
  import 4aShareError from 'https://cdn.skypack.dev/@4a/share-error';
</script>

README

ShareError

可以携带err-code的Error对象

Install

npm i @4a/share-error

Usage

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')