Extends
Members
code
Default:
500
message
Default:
'Internal Server Error'
Constructor
- context optional
- Type:
ObjectorString data in key-value format which will be included in an error log report (but excluded from any request response)
new ServiceError(context)
Represents unexpected internal errors, those will be converted to ServiceError.
All ServiceError(s) are logged for later investigation and resolve to
500 Internal Server Error req response.
Parameters:
Methods
- err
- Type:
Error - context optional
- Type:
Object additional ServiceError context object
- id
- Type:
String route uid
- self
ServiceError.buildFrom(err, context)
ServiceError
static
converts provided error to the ServiceError
Parameters:
ServiceError
setOrigin(id)
ServiceError
set route origin of the error (where the error has been triggered).
the origin will be set automatically - this should be probably a private method?
Parameters:
ServiceError
toLogger()
Object
converts error to fromat intended for remote/file logging
Returns:Object
Inherited Methods
- uid
- Type:
StringorInteger request indentifier
setUID(uid)
Parameters:
toJSON()
Object
Returns:
Object
toSwagger()
Object
Open API schema representation of the error response
Returns:Object