Skip to content

Commit d369e02

Browse files
committedMay 19, 2015
Update README.md
1 parent 13d531e commit d369e02

File tree

1 file changed

+67
-10
lines changed

1 file changed

+67
-10
lines changed
 

‎README.md

+67-10
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,12 @@ throw new errors.ArgumentNullError('username', err);
124124

125125
---------------------------------------
126126

127-
<a name="connection" />
128-
### ConnectionError
127+
<a name="authrequired" />
128+
### AuthenticationRequiredError
129129

130-
Applicable when an error occurs on a connection.
130+
Applicable when an operation requires authentication
131131

132-
new ConnectionError(message[, inner_error])
132+
new AuthenticationRequiredError(message, [inner_error])
133133

134134
__Arguments__
135135

@@ -138,17 +138,17 @@ __Arguments__
138138

139139
```js
140140
// Example
141-
throw new errors.ConnectionError('database connection no longer available', err);
141+
throw new errors.AuthenticationRequiredError("Please provide authentication.", err)
142142
```
143143

144144
---------------------------------------
145145

146-
<a name="authrequired" />
147-
### AuthenticationRequiredError
146+
<a name="connection" />
147+
### ConnectionError
148148

149-
Applicable when an operation requires authentication
149+
Applicable when an error occurs on a connection.
150150

151-
new AuthenticationRequiredError(message, [inner_error])
151+
new ConnectionError(message[, inner_error])
152152

153153
__Arguments__
154154

@@ -157,7 +157,7 @@ __Arguments__
157157

158158
```js
159159
// Example
160-
throw new errors.AuthenticationRequiredError("Please provide authentication.", err)
160+
throw new errors.ConnectionError('database connection no longer available', err);
161161
```
162162

163163
---------------------------------------
@@ -217,6 +217,25 @@ throw new errors.HttpStatusError(err, req);
217217

218218
---------------------------------------
219219

220+
<a name="invalidoperation" />
221+
### InvalidOperationError
222+
223+
Applicable when an invalid operation occurs.
224+
225+
new InvalidOperationError(message[, inner_error])
226+
227+
__Arguments__
228+
229+
* `message` - any message
230+
* `inner_error` - the Error instance that caused the current error. Stack trace will be appended.
231+
232+
```js
233+
// Example
234+
throw new errors.InvalidOperationError('divide by zero', err);
235+
```
236+
237+
---------------------------------------
238+
220239
<a name="io" />
221240
### IOError
222241

@@ -331,6 +350,25 @@ throw new errors.io.FileNotFoundError("./package.json", err)
331350

332351
---------------------------------------
333352

353+
<a name="socket" />
354+
### SocketError
355+
356+
Applicable when an error occurs on a socket.
357+
358+
new SocketError(message[, inner_error])
359+
360+
__Arguments__
361+
362+
* `message` - any message
363+
* `inner_error` - the Error instance that caused the current error. Stack trace will be appended.
364+
365+
```js
366+
// Example
367+
throw new errors.SocketError('socket no longer available', err);
368+
```
369+
370+
---------------------------------------
371+
334372
<a name="notfound" />
335373
### NotFoundError
336374

@@ -502,6 +540,25 @@ throw new errors.SyntaxError("Unexpected token a", err);
502540

503541
---------------------------------------
504542

543+
<a name="timeout" />
544+
### TimeoutError
545+
546+
Applicable when an operation takes longer than the alloted amount.
547+
548+
new TimeoutError(time[, inner_error])
549+
550+
__Arguments__
551+
552+
* `time` - a time duration
553+
* `inner_error` - the Error instance that caused the current error. Stack trace will be appended.
554+
555+
```js
556+
// Example
557+
throw new errors.TimeoutError('100ms', err);
558+
```
559+
560+
---------------------------------------
561+
505562
<a name="type" />
506563
### TypeError
507564

0 commit comments

Comments
 (0)
Please sign in to comment.