error-provider
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -160,2 +160,3 @@ "use strict"; | ||
error = new Error ("Error not found"); | ||
Object.defineProperty (error, "name", { enumerable: false }); | ||
error.name = "ERROR_NOT_FOUND"; | ||
@@ -186,3 +187,3 @@ error.code = error.name; | ||
e.name = e.code; | ||
Object.defineProperty (e, "name", { value: e.code, enumerable: false }); | ||
return e; | ||
@@ -189,0 +190,0 @@ }; |
{ | ||
"name": "error-provider", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "Manages errors for third-party modules", | ||
@@ -5,0 +5,0 @@ "keywords": ["error", "errno", "provider", "libuv"], |
@@ -8,3 +8,3 @@ error-provider | ||
Version: 0.0.5 | ||
Version: 0.0.6 | ||
@@ -26,6 +26,3 @@ When you're writing a third-party module you'll probably deal with errors. If you want to send custom errors to your users you should send a code and then in your documentation explain these codes. | ||
{ [Error: MY_CUSTOM_ERROR] | ||
errno: 1000, | ||
code: "MY_CUSTOM_ERROR", | ||
description: "This is a custom error" } | ||
{ [MY_CUSTOM_ERROR: This is a custom error] errno: 1000, code: "MY_CUSTOM_ERROR" } | ||
*/ | ||
@@ -51,6 +48,5 @@ ``` | ||
custom error | ||
{ [Error: MY_CUSTOM_ERROR] | ||
{ [MY_CUSTOM_ERROR: This is a custom error] | ||
errno: 100, | ||
code: "MY_CUSTOM_ERROR", | ||
description: "This is a custom error", | ||
path: "some/path", | ||
@@ -83,9 +79,6 @@ fn: [Function] } | ||
{ [Error: ENOENT] | ||
errno: 34, | ||
code: "ENOENT", | ||
description: "no such file or directory" } | ||
{ [Error: TEST1] errno: 100, code: "TEST1", description: "test 1" } | ||
{ [Error: TEST1] errno: 100, code: "TEST1", description: "test 1" } | ||
{ [Error: TEST1] errno: 100, code: "TEST1", description: "test 1" } | ||
{ [ENOENT: no such file or directory] errno: 34, code: "ENOENT" } | ||
{ [TEST1: test 1] errno: 100, code: "TEST1" } | ||
{ [TEST1: test 1] errno: 100, code: "TEST1" } | ||
{ [TEST1: test 1] errno: 100, code: "TEST1" } | ||
*/ | ||
@@ -115,3 +108,3 @@ ``` | ||
```javascript | ||
ep.create (ep.next (), "TEST1", "Test 1", { | ||
ep.create (ep.next (), "TEST1", "test 1", { | ||
path: "{p}" | ||
@@ -124,7 +117,3 @@ }); | ||
{ [Error: TEST1] | ||
errno: 100, | ||
code: "TEST1", | ||
description: "Test 1", | ||
path: "some/path" } | ||
{ [TEST1: test 1] errno: 100, code: "TEST1", path: "some/path" } | ||
*/ | ||
@@ -149,3 +138,3 @@ ``` | ||
```javascript | ||
ep.create (ep.next (), "TEST1", "Test {number}", { | ||
ep.create (ep.next (), "TEST1", "test {number}", { | ||
n: "{number}", | ||
@@ -159,6 +148,5 @@ p: "{value}" | ||
{ [Error: TEST1] | ||
{ [TEST1: test 1] | ||
errno: 100, | ||
code: "TEST1", | ||
description: "Test 1", | ||
n: "1", | ||
@@ -165,0 +153,0 @@ p: "ok" } |
185
12601
161