Err

Bajo error class, a thin wrapper of node's Error object. Use this name instead of Error because, of course, Error is a reserved keyword in node.

Constructor

new Err(plugin, msg, …argsopt)

Parameters:
NameTypeAttributesDescription
pluginObject

Plugin instance

msgstring

Error message

argsany<optional>
<repeatable>

Variables to interpolate with error message. Payload object can be pushed as the very last argument

Methods

fatal()

Print error object on screen and terminate app process

formatErrorDetails(value) → {Object}

Pretty format error details

Parameters:
NameTypeDescription
valueObject

Value to format

Returns:
Type: 
Object

write() → {Object}

Create the error object

Returns:

Error object

Type: 
Object