Socket
Socket
Sign inDemoInstall

@blossm/errors

Package Overview
Dependencies
6
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.25 to 0.0.27

2

package.json
{
"name": "@blossm/errors",
"version": "0.0.25",
"version": "0.0.27",
"description": "A library of errors that can be thrown by the network.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -6,2 +6,3 @@ const badRequest = require("./bad_request");

const invalidArgument = require("./invalid_argument");
const forbidden = require("./forbidden");

@@ -14,2 +15,4 @@ module.exports = ({ statusCode, message }) => {

return unauthorized.message(message);
case 403:
return forbidden.message(message);
case 404:

@@ -16,0 +19,0 @@ return resourceNotFound.message(message);

@@ -34,2 +34,11 @@ const { expect } = require("chai");

it("404 correct", () => {
const error = construct({ statusCode: 403, message });
expect(error.toJSON()).to.deep.equal({
statusCode: 403,
code: "Forbidden",
info: {},
message,
});
});
it("404 correct", () => {
const error = construct({ statusCode: 404, message });

@@ -36,0 +45,0 @@ expect(error.toJSON()).to.deep.equal({

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc