clay-errors
v3.1.1
Published
Custom error classes for ClayDB
Downloads
32
Readme
clay-errors
Custom error classes for ClayDB
Installation
$ npm install clay-errors --save
Usage
'use strict'
const { NotFoundError } = require('clay-errors')
{
const doThrow = () => {
throw new NotFoundError({})
}
doThrow()
}
API
[email protected]
Custom error classes for ClayDB
- Functions
NotFoundError
ClassPolicyError
ClassSituationError
Class
Functions
NotFoundError
Class
Resource not found error
Extends:
Error
new NotFoundError(message, detail)
Constructor of NotFoundError class
| Param | Type | Description | | ----- | --- | -------- | | message | string | Error message | | detail | Object | Error detail |
PolicyError
Class
Policy validation error
Extends:
Error
new PolicyError(message, detail)
Constructor of PolicyError class
| Param | Type | Description | | ----- | --- | -------- | | message | string | Error message | | detail | Object | Error detail |
SituationError
Class
Situation error
Extends:
Error
new SituationError(message, detail)
Constructor of SituationError class
| Param | Type | Description | | ----- | --- | -------- | | message | string | Error message | | detail | Object | Error detail |
License
This software is released under the Apache-2.0 License.