@@ -83,7 +83,7 @@ Throws the error passed if it matches any of the specified rules where:
83
83
- ` 'system' ` - matches any languange native error or node assertions.
84
84
- ` 'boom' ` - matches [ ** boom** ] ( https://github.com/hapijs/boom ) errors.
85
85
- ` 'abort' ` - matches an ` AbortError ` , as generated on an ` AbortSignal ` by ` AbortController.abort() ` .
86
- - ` 'timeout' ` - matches an ` TimeoutError ` , as generated by ` AbortSignal.timeout(delay) ` .
86
+ - ` 'timeout' ` - matches a ` TimeoutError ` , as generated by ` AbortSignal.timeout(delay) ` .
87
87
- an object where each property is compared with the error and must match the error property
88
88
value. All the properties in the object must match the error but do not need to include all
89
89
the error properties.
@@ -131,8 +131,14 @@ Return `true` when `err` is one of:
131
131
132
132
### ` isAbort(err) `
133
133
134
- Returns ` true ` when ` err ` is an ` AbortError ` , as generated on an ` AbortSignal ` by ` AbortController.abort() ` .
134
+ Returns ` true ` when ` err ` is an ` AbortError ` , as generated by ` AbortSignal.abort() ` .
135
+
136
+ Note that unlike other errors, ` AbortError ` cannot be considered a class in itself.
137
+ The best way to create a custom ` AbortError ` is with ` new DOMException(message, 'AbortError') ` .
135
138
136
139
### ` isTimeout(err) `
137
140
138
- Returns ` true ` when ` err ` is an ` TimeoutError ` , as generated by ` AbortSignal.timeout(delay) ` .
141
+ Returns ` true ` when ` err ` is a ` TimeoutError ` , as generated by ` AbortSignal.timeout(delay) ` .
142
+
143
+ Note that unlike other errors, ` TimeoutError ` cannot be considered a class in itself.
144
+ The best way to create a custom ` TimeoutError ` is with ` new DOMException(message, 'TimeoutError') ` .
0 commit comments