Throws the error passed if it matches any of the specified rules where:
err
- the error.type
- a single item or an array of items of:
SyntaxError
).'system'
- matches any languange native error or node assertions.'boom'
- matches boom errors.options
- optional object where:
decorate
- an object which is assigned to the err
, copying the properties onto the error.override
- an error used to override err
when err
matches. If used with decorate
,
the override
object is modified.return
- if true
, the error is returned instead of thrown. Defaults to false
.The opposite action of rethrow()
. Ignores any errors matching the specified types
. Any error
not matching is thrown after applying the options
.
Awaits for the value to resolve in the background and then apply either the rethrow()
or ignore()
actions where:
operation
- a function, promise, or value that is await
ed on inside a try...catch
and any
error thrown processed by the action
rule.action
- one of 'rethrow'
or 'ignore'
. Defaults to 'rethrow'
.types
- same as the types
argument passed to rethrow()
or ignore()
. Defaults to 'system'
.options
- same as the options
argument passed to rethrow()
or ignore()
.Returns true
when err
is a boom error.
Returns true
when err
is an error.
Return true
when err
is one of:
EvalError
RangeError
ReferenceError
SyntaxError
TypeError
URIError
AssertionError