@@ -40,7 +40,6 @@ abstract interface class BugseeManager {
4040 ///* stackTrace: the strack trace of the exception, by default it's null
4141 ///* traces: the traces that led to the exception.
4242 ///* events: the events where the exception has been caught.
43- ///* attributes: data related to the exception.
4443 Future <void > logException ({
4544 required Exception exception,
4645 StackTrace ? stackTrace,
@@ -72,11 +71,30 @@ abstract interface class BugseeManager {
7271 /// By default the log file is attached
7372 Future <void > setAttachLogFileEnabled (bool value);
7473
75- //TODO add documentation
76- Future <void > inteceptor (Object error, StackTrace stackTrace);
74+ /// Intecept all unhandled exception thrown by the dart framework
75+ Future <void > inteceptExceptions (Object error, StackTrace stackTrace);
76+
77+ /// Intercept all unhandled rending exception thrown by the Flutter framework
78+ Future <void > inteceptRenderExceptions (FlutterErrorDetails error);
79+
80+ /// Manually add a map of attributes
81+ /// - the map entry key is the attribute name
82+ /// - the map entry value is the attribute value (string, int, boolean)
83+ ///
84+ /// Attributes will be attached to all reported exception unless app is uninstalled
85+ /// or attributes are removed manually
7786 Future <void > addAttributes (Map <String , dynamic > attributes);
87+
88+ /// Manually add an email attached to all reported.
89+ ///
90+ /// The email will be attached to all reported exception unless app is uninstalled
91+ /// or the email is removed manually.
7892 Future <void > addEmailAttribute (String email);
93+
94+ /// Manually remove the email attribute attached using [addEmailAttribute]
7995 Future <void > clearEmailAttribute ();
96+
97+ /// Manually remove an attribute by the given key attached using [addAttributes]
8098 Future <void > clearAttribute (String attribute);
8199}
82100
@@ -332,7 +350,7 @@ final class _BugseeManager implements BugseeManager {
332350 }
333351
334352 @override
335- Future <void > inteceptor (
353+ Future <void > inteceptExceptions (
336354 Object error,
337355 StackTrace stackTrace,
338356 ) async {
@@ -370,4 +388,12 @@ final class _BugseeManager implements BugseeManager {
370388 Future <void > clearEmailAttribute () async {
371389 await Bugsee .clearEmail ();
372390 }
391+
392+ @override
393+ Future <void > inteceptRenderExceptions (FlutterErrorDetails error) async {
394+ await logException (
395+ exception: Exception (error.exception),
396+ stackTrace: error.stack,
397+ );
398+ }
373399}
0 commit comments