New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception in converter function is not shown anywhere. #85
Comments
Hey there -- hrm, good call. I'll check out how I can expose these errors |
What if we start with adding @override
Widget build(BuildContext context) {
return StreamBuilder<ViewModel>(
stream: stream,
builder: (context, snapshot) {
assert(snapshot.error == null, 'snapshot has error ${snapshot.error}'); //at least you will see red flutter error in debug builds.
return widget.builder(
context,
snapshot.hasData ? snapshot.data : latestValue,
);
});
} |
I just ran into a similar problem, only I used onWillChange. If there is any error inside the callback, it is impossible to see it, moreover, the new state will not apply to the builder. |
Hey there! I ran into the same issue today too, and I lost almost a day trying to figure this out. Any idea how we can avoid those error to be swallowed ? |
Hey all -- thanks for the feedback and apologies on being slow on this one. I think since I generally test converter functions I didn't run into this as much, but it's an important topic. I've got a branch going to help alleviate these issues. Could you please check out the following PR and tell me if it would help? |
Fixed |
If exception is thrown in converter function it is not shown anywhere. Check an example app - exception is thrown when counter is odd number. App just works, but it shows only even numbers. It is difficult to catch such bugs. Exception is not visible anywhere - maybe at least it could be logged to console?
The text was updated successfully, but these errors were encountered: