error-ninja
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -16,3 +16,3 @@ 'use strict'; | ||
const UriError = createErrorClass(`UriError`); | ||
const CustomUriError = createErrorClass(`CustomUriError`); | ||
const VideoStreamError = createErrorClass(`VideoStreamError`); | ||
@@ -22,3 +22,3 @@ const FatalError = createErrorClass(`FatalError`); | ||
/** | ||
* Faux function to demonstrate how native errors (e.g. an undefined variable) and error ninjas (new UriError) get | ||
* Faux function to demonstrate how native errors (e.g. an undefined variable) and error ninjas (new CustomUriError) get | ||
* thrown and can be caught by the calling code in the same way. | ||
@@ -34,3 +34,3 @@ * | ||
if (typeof uri !== `string`) { | ||
throw new UriError(`INVALID_URI`, `The specified URI is not a string.`, { uri, typeOf: typeof uri }); | ||
throw new CustomUriError(`INVALID_URI`, `The specified URI is not a string.`, { uri, typeOf: typeof uri }); | ||
} | ||
@@ -37,0 +37,0 @@ |
@@ -10,8 +10,13 @@ { | ||
"name": "error-ninja", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Allows us to pre-define error types and error messages in each module.", | ||
"keywords": [ | ||
"error", | ||
"errors", | ||
"handling", | ||
"handle", | ||
"constructor", | ||
"construct", | ||
"ninja", | ||
"define", | ||
"errorninja", | ||
"decorate", | ||
@@ -23,4 +28,16 @@ "decoration", | ||
"throw", | ||
"try", | ||
"catch", | ||
"promise" | ||
"finally", | ||
"trycatch", | ||
"promise", | ||
"async", | ||
"boundary", | ||
"boundaries", | ||
"chain", | ||
"chaining", | ||
"link", | ||
"linking", | ||
"propagation", | ||
"interception" | ||
], | ||
@@ -27,0 +44,0 @@ "main": "errorNinja.js", |
@@ -97,3 +97,3 @@ # Error-Ninja | ||
__isLite: true }, | ||
{ name: 'UriError', | ||
{ name: 'CustomCustomUriError', | ||
id: 'INVALID_URI', | ||
@@ -138,3 +138,3 @@ message: 'The specified URI is not a string.', | ||
data: undefined }, | ||
{ UriError: [INVALID_URI] The specified URI is not a string. | ||
{ CustomUriError: [INVALID_URI] The specified URI is not a string. | ||
at connectToVideoServer (/Users/josh/Repositories/Personal/Error-Ninja/examples/example.js:52:26) | ||
@@ -152,3 +152,3 @@ at startVideoStream (/Users/josh/Repositories/Personal/Error-Ninja/examples/example.js:66:9) | ||
__options: { fullInsight: true }, | ||
name: 'UriError', | ||
name: 'CustomUriError', | ||
id: 'INVALID_URI', | ||
@@ -173,3 +173,3 @@ __originalMsg: 'The specified URI is not a string.', | ||
=========================================================================== | ||
<3> UriError: [INVALID_URI] The specified URI is not a string. | ||
<3> CustomUriError: [INVALID_URI] The specified URI is not a string. | ||
--------------------------------------------------------------------------- | ||
@@ -203,3 +203,3 @@ @property {object} uri: <null> | ||
=========================================================================== | ||
<3> UriError: [INVALID_URI] The specified URI is not a string. | ||
<3> CustomUriError: [INVALID_URI] The specified URI is not a string. | ||
=========================================================================== | ||
@@ -206,0 +206,0 @@ @property {object} uri: <null> |
24465