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

new-error

Package Overview
Dependencies
Maintainers
2
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

new-error - npm Package Compare versions

Comparing version 1.0.9 to 1.0.10

8

build/error-types/BaseError.d.ts

@@ -31,2 +31,10 @@ import ExtendableError from 'es6-error';

/**
* Get the class name of the error
*/
getErrorName(): string;
/**
* Get the low level error type
*/
getErrorType(): string;
/**
* Returns the status code.

@@ -33,0 +41,0 @@ */

@@ -43,2 +43,14 @@ "use strict";

/**
* Get the class name of the error
*/
getErrorName() {
return this.name;
}
/**
* Get the low level error type
*/
getErrorType() {
return this._type;
}
/**
* Returns the status code.

@@ -45,0 +57,0 @@ */

@@ -65,2 +65,6 @@ /**

/**
* Get the class name of the error
*/
getErrorName(): string;
/**
* Returns the high level error code

@@ -78,2 +82,6 @@ */

/**
* Get the low level error type
*/
getErrorType(): string;
/**
* Returns the attached error

@@ -80,0 +88,0 @@ */

@@ -0,1 +1,14 @@

## 1.0.10 - Sun May 17 2020 21:02:32
**Contributor:** Theo Gravity
- Add new methods and documentation (#4)
Added:
- `BaseError#getErrorType()`
- `BaseError#getErrorName()`
* Update readme
## 1.0.9 - Sat May 16 2020 00:39:12

@@ -2,0 +15,0 @@

2

package.json
{
"name": "new-error",
"version": "1.0.9",
"version": "1.0.10",
"description": "A production-grade error creation and serialization library designed for Typescript",

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

@@ -14,2 +14,3 @@ # new-error

- Create your own custom error types with custom messaging, status codes and metadata.
* Errors can be created via a registry (recommended), or you can create your own error classes.
- Attach an error to your error object to get the full error chain.

@@ -41,2 +42,3 @@ - Selectively expose error metadata based on internal or external use.

- [Getters](#getters)
- [Basic setters](#basic-setters)
- [Attaching errors](#attaching-errors)

@@ -368,3 +370,3 @@ - [Format messages](#format-messages)

Except for the serialization methods, all methods are chainable.
Except for the getter and serialization methods, all other methods are chainable.

@@ -375,3 +377,5 @@ Generated errors extend the `BaseError` class, which supplies the manipulation methods.

- `BaseError#getErrorName()`
- `BaseError#getCode()`
- `BaseError#getErrorType()`
- `BaseError#getSubCode()`

@@ -383,2 +387,11 @@ - `BaseError#getStatusCode()`

## Basic setters
If you use the registry, you should not need to us these setters as the registry
sets the values already.
- `BaseError#withErrorType(type: string): this`
- `BaseError#withErrorCode(code: string | number): this`
- `BaseError#withErrorSubCode(code: string | number): this`
## Attaching errors

@@ -385,0 +398,0 @@

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