File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,15 +31,15 @@ Example
3131throw ono (" %s is invalid. Must be at least %d characters." , username, minLength);
3232
3333// 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 " );
3535
3636// Throw an error with custom properties (even a custom method!)
3737throw ono ({code: 413 , status: " Invalid data" , retry : function () {... }});
3838
3939// Add custom properties to an existing Error
4040throw ono (err, {code: 413 , status: " Invalid data" , retry : function () {... }})
4141
42- // Any of the above can be throw a specific Error type
42+ // Any of the above can throw a specific Error subtype instead
4343throw ono .range (... ); // RangeError
4444throw ono .syntax (... ); // SyntaxError
4545throw ono .reference (... ); // ReferenceError
You can’t perform that action at this time.
0 commit comments