check-error 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
</h1>
|
|
6
6
|
|
|
7
7
|
<p align=center>
|
|
8
|
-
Error comparison and information related utility for
|
|
8
|
+
Error comparison and information related utility for <a href="http://nodejs.org">node</a> and the browser.
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
11
|
<p align=center>
|
|
@@ -104,13 +104,13 @@ The primary export of `check-error` is an object which has the following methods
|
|
|
104
104
|
* `getMessage(err)` - Retrieves the message of an error or `err` itself if it's a String. If `err` or `err.message` is undefined we return an empty String.
|
|
105
105
|
|
|
106
106
|
```js
|
|
107
|
-
var checkError = require('
|
|
107
|
+
var checkError = require('check-error');
|
|
108
108
|
```
|
|
109
109
|
|
|
110
110
|
#### .compatibleInstance(err, errorLike)
|
|
111
111
|
|
|
112
112
|
```js
|
|
113
|
-
var checkError = require('
|
|
113
|
+
var checkError = require('check-error');
|
|
114
114
|
|
|
115
115
|
var funcThatThrows = function() { throw new TypeError('I am a TypeError') };
|
|
116
116
|
var caughtErr;
|
|
@@ -130,7 +130,7 @@ checkError.compatibleInstance(caughtErr, new TypeError('Another error')); // fal
|
|
|
130
130
|
#### .compatibleConstructor(err, errorLike)
|
|
131
131
|
|
|
132
132
|
```js
|
|
133
|
-
var checkError = require('
|
|
133
|
+
var checkError = require('check-error');
|
|
134
134
|
|
|
135
135
|
var funcThatThrows = function() { throw new TypeError('I am a TypeError') };
|
|
136
136
|
var caughtErr;
|
|
@@ -149,7 +149,7 @@ checkError.compatibleConstructor(caughtErr, RangeError); // false
|
|
|
149
149
|
#### .compatibleMessage(err, errMatcher)
|
|
150
150
|
|
|
151
151
|
```js
|
|
152
|
-
var checkError = require('
|
|
152
|
+
var checkError = require('check-error');
|
|
153
153
|
|
|
154
154
|
var funcThatThrows = function() { throw new TypeError('I am a TypeError') };
|
|
155
155
|
var caughtErr;
|
|
@@ -171,7 +171,7 @@ checkError.compatibleMessage(caughtErr, 'I do not exist'); // false
|
|
|
171
171
|
#### .getConstructorName(errorLike)
|
|
172
172
|
|
|
173
173
|
```js
|
|
174
|
-
var checkError = require('
|
|
174
|
+
var checkError = require('check-error');
|
|
175
175
|
|
|
176
176
|
var funcThatThrows = function() { throw new TypeError('I am a TypeError') };
|
|
177
177
|
var caughtErr;
|
|
@@ -190,7 +190,7 @@ checkError.getConstructorName(caughtErr) // 'TypeError'
|
|
|
190
190
|
#### .getMessage(err)
|
|
191
191
|
|
|
192
192
|
```js
|
|
193
|
-
var checkError = require('
|
|
193
|
+
var checkError = require('check-error');
|
|
194
194
|
|
|
195
195
|
var funcThatThrows = function() { throw new TypeError('I am a TypeError') };
|
|
196
196
|
var caughtErr;
|
package/package.json
CHANGED