Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@loves/loves-web-error-handler

Package Overview
Dependencies
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@loves/loves-web-error-handler - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

6

app.js

@@ -77,4 +77,10 @@ const webErrorHandler = {

},
unavailableError(message = 'The service is currently unavailable.') {
return {
message,
statusCode: 503,
};
},
};
module.exports = webErrorHandler;

7

package.json
{
"name": "@loves/loves-web-error-handler",
"version": "0.3.0",
"version": "0.4.0",
"description": "A web error handler that formats responses.",

@@ -16,2 +16,3 @@ "main": "app.js",

"devDependencies": {
"chai": "^4.1.2",
"eslint": "^3.19.0",

@@ -31,5 +32,3 @@ "eslint-config-airbnb": "^14.1.0",

"homepage": "https://github.com/LovesTravelStops/loves-web-error-handler#readme",
"dependencies": {
"chai": "^4.1.2"
}
"dependencies": {}
}

@@ -61,3 +61,2 @@ const chai = require('chai');

});
it('should create 404 error correctly', () => {

@@ -128,2 +127,19 @@ const expected = {

});
it('should create service unavailable error correctly', () => {
const expected = {
message: 'The service is currently unavailable.',
statusCode: 503,
};
const actual = testableApp.unavailableError();
expect(actual).to.deep.equal(expected);
});
it('should create service unavailable error with specific message correctly', () => {
const errorString = 'This service is under maintenance until 12 pm CST.';
const expected = {
message: errorString,
statusCode: 503,
};
const actual = testableApp.unavailableError(errorString);
expect(actual).to.deep.equal(expected);
});
it('should add validation errors correctly', () => {

@@ -130,0 +146,0 @@ const message = 'Form validation failed.';

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