Functions for throwing errors.
This function throws an error with a message constructed by concatenating all arguments passed to it.
fail('Failed to ', 'insert', ' record');
// -> throws error with message 'Failed to insert record'The benefit of using this function over throw is that it can
be used in an expression.
const x = params.x || fail('No x specified');This function throws an error with a message generated from
expanding a message template using the
format() function.
failMsg('Failed to <action> record', { action: 'insert' })
// -> throws error with message 'Failed to insert record'Function to rethrow an error. The benefit of using this function over throw
is that it can be used in an expression.