instrumentError method
Adds instrumentation to error handling.
correlationId
(optional) transaction id to trace execution through call chain.name
a method name.err
an occured error
Implementation
void instrumentError(String? correlationId, String name, err,
[bool? reerror = false]) {
if (err != null) {
logger.error(correlationId, ApplicationException().wrap(err),
'Failed to call %s method', [name]);
counters.incrementOne(name + '.call_errors');
if (reerror != null && reerror == true) {
throw err;
}
}
}