recordError method
Future<void>
recordError({
- required String exception,
- required String information,
- required String reason,
- bool fatal = false,
- String? buildId,
- String? stackTraceElements,
override
Submits a Crashlytics report of a caught error.
Implementation
@override
Future<void> recordError({
required String exception,
required String information,
required String reason,
bool fatal = false,
String? buildId,
String? stackTraceElements,
// List<Map<String, String>>? stackTraceElements,
}) async {
try {
await methodChannel.invokeMethod<void>('reportUserException', <String, dynamic>{
'exception': exception,
'information': information,
'reason': reason,
'fatal': fatal,
'buildId': buildId ?? '',
'stackTrace': stackTraceElements ?? [],
});
} on PlatformException catch (e, s) {
// convertPlatformException(e, s);
var stackTrace = s;
if (stackTrace == StackTrace.empty) {
stackTrace = StackTrace.current;
}
if (e is! PlatformException) {
Error.throwWithStackTrace(e, stackTrace);
}
Error.throwWithStackTrace(
Exception('MarvelFlutter#recordError'),
stackTrace,
);
}
}