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

cf-errors

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cf-errors - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

2

package.json
{
"name": "cf-errors",
"version": "0.1.5",
"version": "0.1.6",
"description": "Extensible error library",

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

@@ -7,3 +7,3 @@ cf-errors

## Installation
##Installation
```javascript

@@ -24,3 +24,3 @@ $ npm install cf-errors

<a name="constructor" />
## Creating an error
##Creating an error
```javascript

@@ -52,3 +52,3 @@ var CFError = require('cf-errors');

<a name="cause" />
## Extending with a previous error
##Extending with a previous error
```javascript

@@ -62,3 +62,3 @@ var extendedError = new CFError({

<a name="stack" />
## Printing the stack
##Printing the stack
will print the stack of all previous errors too

@@ -70,3 +70,3 @@ ```javascript

<a name="toString" />
## toString()
##toString()
Will print the whole chain of errors in a nice way. </br>

@@ -81,3 +81,3 @@ You can always override it if you want.

<a name="predefined" />
## Predefined Error Types
##Predefined Error Types
```javascript

@@ -89,3 +89,3 @@ var CFError = require('cf-errors');

They are actually just simple objects so using the extension capability allows us to use them easily and extend them when needed.
#### Http Errors
####Http Errors
All http errors are available.

@@ -109,7 +109,7 @@ They will contain a field name 'statusCode' for your use.

```
#### Node Errors
####Node Errors
All node.js core errors are also available using the Errors.Node object.
<a name="inherit" />
## Inheriting the previous error type
##Inheriting the previous error type
Creating an error with the same name as its cause can be achieved using 'Inherit' as the error name.

@@ -132,3 +132,3 @@ ```javascript

<a name="getfirstvalue" />
## Getting the value of the first occurrence of a field in the chain
##Getting the value of the first occurrence of a field in the chain
Sometimes you will populate an error with a field and wrap it with an additional error. In order to get the value of the field you will need to recursively go over the whole chain. </br>

@@ -145,4 +145,4 @@ In order to get the first value of a field in the chain use 'getFirstValue' function.

<a name="tests" />
## Running the tests
##Running the tests
'npm test' or 'gulp unit_test'
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