register #
Available since 2.17.1
Register a new standard KuzzleError
Arguments #
register (domain: string, subDomain: string, name: string, definition: CustomErrorDefinition): void
Argument | Type | Description |
---|---|---|
domain | string | Domain name |
subDomain | string | Subdomain name |
name | string | Standard error name |
definition | CustomErrorDefinition | Standard error definition |
Example #
app.errors.register('app', 'api', 'custom', {
class: 'BadRequestError',
description: 'This is a custom error from API subdomain',
message: 'Custom %s error',
});
Edit this page on Github (opens new window)