New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@argodigital/formula-errors

Package Overview
Dependencies
Maintainers
8
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@argodigital/formula-errors

API errors for *formula* services.

latest
npmnpm
Version
1.1.1
Version published
Maintainers
8
Created
Source

formula-errors

API errors for formula services.

Provides

Methods:

  • createApiError,
  • createJsonApiError

Objects (classes):

  • ApiError,
  • JsonApiError

Customization

Typical HTTP errors resolve name, code, message & statusCode attributes with help of statuses package. For example:

throw createApiError(404)

Builds following error object:

{
    message: 'Not Found',
    code: 'NotFound',
    docUrl: '',
    statusCode: 404,
    type: 'api_error'
}

Above will be also true with:

throw createApiError('NotFound')

To customize message and docUrl:

throw createApiError('NotFound', 'Could not find the user', 'http://argodigial.com/doc/user/registration')

FAQs

Package last updated on 13 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts