Comparing version 1.0.9 to 1.0.10
@@ -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 @@ |
{ | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50086
687
552