mirror of
https://github.com/cloudflare/wrangler-action.git
synced 2025-02-27 05:34:45 +01:00
30 lines
604 B
Markdown
30 lines
604 B
Markdown
# Extendable Error [](https://travis-ci.org/vilic/extendable-error)
|
|
|
|
A simple abstract extendable error class that extends `Error`, which handles the error `name`, `message` and `stack` property.
|
|
|
|
## Install
|
|
|
|
```sh
|
|
npm install extendable-error --save
|
|
```
|
|
|
|
## Usage
|
|
|
|
```ts
|
|
import ExtendableError from 'extendable-error';
|
|
|
|
class SomeError extends ExtendableError {
|
|
constructor(
|
|
message: string,
|
|
public code: number
|
|
) {
|
|
super(message);
|
|
}
|
|
}
|
|
|
|
let someError = new SomeError('Some error', 0x0001);
|
|
```
|
|
|
|
## License
|
|
|
|
MIT License.
|