onError method
Called when the agent encounters an error.
Implementation
@override
void onError(Object error, StackTrace stackTrace) {
logger.error(
'Agent error occurred',
error: error,
stackTrace: stackTrace,
tag: 'OBSERVER',
);
}