Constructor
# new module:APIWarn(code, message, fieldsopt, optionsopt)
APIWarn is used to pass warning from anywhere in the express call stack to the error handling middleware.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
code |
Number
|
The HTTP code of the warning |
|
message |
string
|
The warning message |
|
fields |
string
|
Array.<string>
|
null
|
<optional> |
Fields (query parameters) related to the warning |
options |
Object
|
<optional> |
Options |
Example
throw new APIWarn(404, "This page doesn't exist.");