recordError method
Future<void>
recordError(
- dynamic exception,
- StackTrace? stack, {
- dynamic reason,
- Iterable<
Object> information = const [], - bool fatal = false,
override
Logs a custom error with an optional stack trace and reason.
Implementation
@override
Future<void> recordError(
dynamic exception,
StackTrace? stack, {
dynamic reason,
Iterable<Object> information = const [],
bool fatal = false,
}) async {
await Sentry.captureException(
exception,
stackTrace: stack,
hint: reason,
withScope: (scope) {
if (fatal) {
scope.level = SentryLevel.fatal;
}
if (information.isNotEmpty) {
scope.setContexts('information', {'data': information.toList()});
}
},
);
}