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

httpexceptions

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

httpexceptions - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

25

lib/http-exception.js

@@ -13,36 +13,19 @@ var HTTPException = (function () {

}
this.message = message;
this.status = status;
this.message = message || '';
if (innerException) {
if (innerException instanceof Error) {
this.innerException = innerException;
this.message = this.getMessages() + ", innerException: " + this.innerException.message;
this.message = this.message + ", innerException: " + this.innerException.message;
}
else if (typeof innerException === "string") {
this.innerException = new Error(innerException);
this.message = this.getMessages() + ", innerException: " + this.innerException.message;
this.message = this.message + ", innerException: " + this.innerException.message;
}
else {
this.innerException = innerException;
this.message = this.getMessages() + ", innerException: " + this.innerException;
this.message = this.message + ", innerException: " + this.innerException;
}
}
else {
this.message = message;
}
}
/**
*
* @returns {number}
*/
HTTPException.prototype.getStatus = function () {
return this.status;
};
/**
*
* @returns {string}
*/
HTTPException.prototype.getMessages = function () {
return this.type.replace(/_/gi, ' ') + (this.message ? ' - ' + this.message : '');
};
return HTTPException;

@@ -49,0 +32,0 @@ })();

@@ -28,4 +28,4 @@ declare class Error {

this.message = message;
this.status = status;
this.message = message || '';

@@ -35,35 +35,17 @@ if (innerException) {

this.innerException = innerException;
this.message = this.getMessages() + ", innerException: " + this.innerException.message;
this.message = this.message + ", innerException: " + this.innerException.message;
}
else if (typeof innerException === "string") {
this.innerException = new Error(innerException);
this.message = this.getMessages() + ", innerException: " + this.innerException.message;
this.message = this.message + ", innerException: " + this.innerException.message;
}
else {
this.innerException = innerException;
this.message = this.getMessages() + ", innerException: " + this.innerException;
this.message = this.message + ", innerException: " + this.innerException;
}
}
else {
this.message = message;
}
}
/**
*
* @returns {number}
*/
getStatus():number{
return this.status;
}
/**
*
* @returns {string}
*/
getMessages(): string{
return this.type.replace(/_/gi, ' ') + (this.message ? ' - ' + this.message : '');
}
}
export = HTTPException;

2

package.json
{
"name": "httpexceptions",
"version": "1.0.3",
"version": "1.0.4",
"description": "Provide exception for HTTP Rest API",

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

Sorry, the diff of this file is not supported yet

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