Core
Framework v2.x
2

register #

Available since 2.17.1

Register a new standard KuzzleError

Arguments #

Copied to clipboard!
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 #

Copied to clipboard!
app.errors.register('app', 'api', 'custom', {
  class: 'BadRequestError',
  description: 'This is a custom error from API subdomain',
  message: 'Custom %s error',
});