3.1.1 • Published 7 years ago

clay-errors v3.1.1

Weekly downloads
215
License
Apache-2.0
Repository
github
Last release
7 years ago

clay-errors

Build Status npm Version JS Standard

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

clay-errors@3.0.1

Custom error classes for ClayDB

Functions

NotFoundError Class

Resource not found error

Extends:

  • Error

new NotFoundError(message, detail)

Constructor of NotFoundError class

ParamTypeDescription
messagestringError message
detailObjectError detail

PolicyError Class

Policy validation error

Extends:

  • Error

new PolicyError(message, detail)

Constructor of PolicyError class

ParamTypeDescription
messagestringError message
detailObjectError detail

SituationError Class

Situation error

Extends:

  • Error

new SituationError(message, detail)

Constructor of SituationError class

ParamTypeDescription
messagestringError message
detailObjectError detail

License

This software is released under the Apache-2.0 License.

Links