File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -31,15 +31,15 @@ Example
31
31
throw ono (" %s is invalid. Must be at least %d characters." , username, minLength);
32
32
33
33
// Wrap and re-throw an error without losing the original error's message and stack
34
- throw ono (err, " Unable to save account #%d " , accountNumber );
34
+ throw ono (err, " An error occurred while saving your changes " );
35
35
36
36
// Throw an error with custom properties (even a custom method!)
37
37
throw ono ({code: 413 , status: " Invalid data" , retry : function () {... }});
38
38
39
39
// Add custom properties to an existing Error
40
40
throw ono (err, {code: 413 , status: " Invalid data" , retry : function () {... }})
41
41
42
- // Any of the above can be throw a specific Error type
42
+ // Any of the above can throw a specific Error subtype instead
43
43
throw ono .range (... ); // RangeError
44
44
throw ono .syntax (... ); // SyntaxError
45
45
throw ono .reference (... ); // ReferenceError
You can’t perform that action at this time.
0 commit comments