# new errors()
The error code to string mapping
Members
# (static) map :object
the error mapping
Type:
- object
Methods
# (static) getMessage(code) → {Promise.<string>}
This function resolves an error code to an error message from the mapping and runs smarty conversions on it
Parameters:
Name | Type | Description |
---|---|---|
code |
string | the error code |
Returns:
the smartified message or "undefined error code"
- Type
- Promise.<string>
Example
await j.errors.getMessage("AE_024") // this will return the translated string for "{$qrcode_invalid}"