feat: ignoring addError in reported stacktrace #3585
Labels
enhancement candidate
Candidate for enhancement but additional research is needed
pkg:bloc
This issue is related to the bloc package
Milestone
Description
When reading through the stack trace reported when calling
addError(Exception('Hello there'));
the first frame is alwaysBlocBase.addError
. This is becauseaddError()
implementation passesStackTrace.current
if no stack trace is provided:Here's a sample report from Crashlytics:
Desired Solution
The
BlocBase.addError
should be omitted in the stack trace passed toonError
if no stack trace is passed toaddError
.The solution I used in my BlocObserver is to create new Trace (using
stack_trace
package) and skip frames related toBlocBase.addError
:Alternatives Considered
StackTrace.current
toaddError
The text was updated successfully, but these errors were encountered: