Closed tbm98 closed 3 years ago
Hello!
What is the use-case? I'm all for changing Error
to something more specific. But I don't think throwing the original exception is a good call (on top of that, there can be more than one)
That would mean the exception thrown by state =
would changed based on the number of listeners and what they do. I don't like the idea of coupling those logics.
I think throw original exceptions is helpful to trace/ identify problems more quickly. Currently, it only throws Error() without information and developers don't know why it happens.
instance is this error: river_pod/issues/730
it only show
======== Exception caught by gesture ===============================================================
The following Error was thrown while handling a gesture:
Instance of 'Error'
But if it's about tracing, we can improve tracing without necessarily rethrowing the exception.
We could for example do:
List<Object> errors;
List<StackTrace> stackTraces;
if (didThrow) {
throw NotifyListenerError(errors, stackTraces);
}
(with a toString
override to print the errors)
This achieves the same effect, but without making the behaviour of set =
changed based on the number of listeners.
Oh. I didn't know that can has multiple exception
Codecov Report
96.38% <ø> (-0.05%)
100.00% <100.00%> (ø)