The error handler equivalent for the onDetect function.
If onDetect is not null, and this is null, errors are silently ignored.
final void Function(Object error, StackTrace stackTrace) onDetectError;