@@ -124,12 +124,12 @@ throw new errors.ArgumentNullError('username', err);
124
124
125
125
---------------------------------------
126
126
127
- <a name =" connection " />
128
- ### ConnectionError
127
+ <a name =" authrequired " />
128
+ ### AuthenticationRequiredError
129
129
130
- Applicable when an error occurs on a connection.
130
+ Applicable when an operation requires authentication
131
131
132
- new ConnectionError (message[, inner_error])
132
+ new AuthenticationRequiredError (message, [ inner_error])
133
133
134
134
__ Arguments__
135
135
@@ -138,17 +138,17 @@ __Arguments__
138
138
139
139
``` js
140
140
// Example
141
- throw new errors.ConnectionError ( ' database connection no longer available ' , err);
141
+ throw new errors.AuthenticationRequiredError ( " Please provide authentication. " , err)
142
142
```
143
143
144
144
---------------------------------------
145
145
146
- <a name =" authrequired " />
147
- ### AuthenticationRequiredError
146
+ <a name =" connection " />
147
+ ### ConnectionError
148
148
149
- Applicable when an operation requires authentication
149
+ Applicable when an error occurs on a connection.
150
150
151
- new AuthenticationRequiredError (message, [ inner_error])
151
+ new ConnectionError (message[, inner_error])
152
152
153
153
__ Arguments__
154
154
@@ -157,7 +157,7 @@ __Arguments__
157
157
158
158
``` js
159
159
// Example
160
- throw new errors.AuthenticationRequiredError ( " Please provide authentication. " , err)
160
+ throw new errors.ConnectionError ( ' database connection no longer available ' , err);
161
161
```
162
162
163
163
---------------------------------------
@@ -217,6 +217,25 @@ throw new errors.HttpStatusError(err, req);
217
217
218
218
---------------------------------------
219
219
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
+
220
239
<a name =" io " />
221
240
### IOError
222
241
@@ -331,6 +350,25 @@ throw new errors.io.FileNotFoundError("./package.json", err)
331
350
332
351
---------------------------------------
333
352
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
+
334
372
<a name =" notfound " />
335
373
### NotFoundError
336
374
@@ -502,6 +540,25 @@ throw new errors.SyntaxError("Unexpected token a", err);
502
540
503
541
---------------------------------------
504
542
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
+
505
562
<a name =" type " />
506
563
### TypeError
507
564
0 commit comments