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

node-exceptions

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-exceptions - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

11

CHANGELOG.md

@@ -0,1 +1,7 @@

<a name="1.0.1"></a>
## [1.0.1](https://github.com/poppinss/node-exceptions/compare/v1.0.0...v1.0.1) (2016-02-05)
<a name="1.0.0"></a>

@@ -8,5 +14,2 @@ # 1.0.0 (2016-02-04)

* Initial commit ([24ff232](https://github.com/poppinss/node-exceptions/commit/24ff232))
* **travis:** added travis.yml file ([51aa3e6](https://github.com/poppinss/node-exceptions/commit/51aa3e6))
* **travis:** added travis.yml file ([51aa3e6](https://github.com/poppinss/node-exceptions/commit/51aa3e6))
{
"name": "node-exceptions",
"version": "1.0.0",
"version": "1.0.1",
"description": "personalized and extendable exception class for nodejs",

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

@@ -41,3 +41,3 @@ Node Exceptions

} catch (e) {
console.log(e.code) // equals 500
console.log(e.status) // equals 500
console.log(e.name) // equals MyCustomError

@@ -50,4 +50,4 @@ console.log(e.message) // Something bad happened

## Custom error code
It is also possible to have a custom error code when throwing exceptions.
## Custom error status
It is also possible to have a custom error status when throwing exceptions.

@@ -62,3 +62,3 @@ ```javascript

} catch (e) {
console.log(e.code) // equals 404
console.log(e.status) // equals 404
}

@@ -65,0 +65,0 @@ ```

@@ -12,9 +12,9 @@ 'use strict'

module.exports = function LogicalException (message, code) {
module.exports = function LogicalException (message, status) {
Error.captureStackTrace(this, this.constructor)
this.name = this.constructor.name
this.message = message
this.code = code || 500
this.status = status || 500
}
require('util').inherits(module.exports, Error)
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