You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

redink-errors

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redink-errors

Module to handle Redink errors

0.0.2
Source
npm
Version published
Weekly downloads
3
-62.5%
Maintainers
1
Weekly downloads
 
Created
Source

redink-errors

Module to handle Redink errors

CircleCI codecov

Installation

Install node.js Then:

$ npm install --save redink-errors

Overview

Redink error modules

Once you have imported the Redink error classes, all you have to do is throw your constructed error.

Example server error:

import { RedinkError, RedinkDatabaseError } from 'redink-errors';

const throwError = (variable) => {
  if (variable === 0) {
    throw new RedinkError('Cannot divide by 0');
  }

  return 10 / variable;
}

Example http error:

import { RedinkHttpError } from 'redink-errors';

const throwHttpError = (variable) => {
  if (variable === 0) {
    throw new RedinkHttpError(404, 'Cannot divide by 0');
  }

  return 10 / variable;
}

Keywords

Redink

FAQs

Package last updated on 21 Jul 2016

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