Socket
Socket
Sign inDemoInstall

okra-error

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

okra-error

This is an Okra error TypeScript Package with methods for handling errors.


Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Okra-error package

This is an Okra error TypeScript Package with methods for handling errors.

Usage

import { HandleError, ValidationError, OkraBaseError } from 'okra-error'
// 
At the point of Error, always ensure you throw the instance of the such as 

throw new OkraBaseError() throw new ValidationError('Invalid credentials')


Then at the central point to ensrue consistency of the error call the error class and handleError.
const errorHandler = new ErrorHandler(logger);
const processedError = errorHandler.handleError(error, 'validation')

This will ensure you have a well processed error response accross the app.

Keywords

FAQs

Package last updated on 29 Nov 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc