@@ -53,6 +53,13 @@ class InstabugWidget extends StatefulWidget {
53
53
/// If true, the Flutter error will be reported as a non-fatal crash, instead of a fatal crash.
54
54
final bool nonFatalFlutterErrors;
55
55
56
+ /// The level of the non-fatal exception.
57
+ ///
58
+ /// This is used to determine the level of the non-fatal exception.
59
+ ///
60
+ /// Note: This has no effect if [nonFatalFlutterErrors] is false.
61
+ final NonFatalExceptionLevel nonFatalExceptionLevel;
62
+
56
63
/// Whether to exit the app on Flutter error.
57
64
///
58
65
/// If true, the app will exit when a Flutter error occurs.
@@ -77,6 +84,7 @@ class InstabugWidget extends StatefulWidget {
77
84
this .flutterErrorHandler,
78
85
this .platformErrorHandler,
79
86
this .nonFatalFlutterErrors = false ,
87
+ this .nonFatalExceptionLevel = NonFatalExceptionLevel .error,
80
88
this .shouldExitOnFlutterError = false ,
81
89
}) : super (key: key);
82
90
@@ -109,6 +117,7 @@ class _InstabugWidgetState extends State<InstabugWidget> {
109
117
CrashReporting .reportHandledCrash (
110
118
details.exception,
111
119
details.stack ?? StackTrace .current,
120
+ level: widget.nonFatalExceptionLevel,
112
121
);
113
122
} else {
114
123
CrashReporting .reportCrash (
@@ -123,7 +132,7 @@ class _InstabugWidgetState extends State<InstabugWidget> {
123
132
exit (1 );
124
133
}
125
134
};
126
-
135
+
127
136
PlatformDispatcher .instance.onError = (Object error, StackTrace stack) {
128
137
// Call user's custom handler if provided
129
138
if (widget.platformErrorHandler != null ) {
0 commit comments