Skip to content
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

Add try..catch while initing controllers and services #23

Closed
hwnprsd opened this issue Jul 23, 2020 · 3 comments
Closed

Add try..catch while initing controllers and services #23

hwnprsd opened this issue Jul 23, 2020 · 3 comments
Labels
enhancement New feature or request Published This new feature has been published.

Comments

@hwnprsd
Copy link

hwnprsd commented Jul 23, 2020

Any exception that gets thrown inside MomentumRoot's _init() results in:

The following assertion was thrown     building FutureBuilder<bool>(dirty, state:_FutureBuilderState<bool>#9e6fe):
  8 Failed assertion: boolean expression must not be null

The dev can never understand which one of the init methods threw which exception. This especially becomes painful when you blind code multiple controllers and then run the app to see if they are working as you envisioned.

Adding a try...catch inside _init() and then logging the stack-trace would probably save a bunch of time for devs who do the above.

hwnprsd pushed a commit to hwnprsd/momentum that referenced this issue Jul 23, 2020
@xamantra xamantra added enhancement New feature or request RTP Ready to publish labels Jul 23, 2020
@xamantra
Copy link
Owner

You can now check this update on your projects. Try to use the dev-1.3.1 channel for momentum:

dependencies:
  flutter:
    sdk: flutter
  momentum:
    git:
      url: https://github.com/xamantra/momentum.git
      ref: dev-1.3.1

@hwnprsd
Copy link
Author

hwnprsd commented Jul 25, 2020

Seems to be working fine! Thanks

@hwnprsd hwnprsd closed this as completed Jul 25, 2020
@xamantra
Copy link
Owner

This update is now live on pub.dev - v1.3.1. Will now be closed.

@xamantra xamantra reopened this Jul 26, 2020
@xamantra xamantra added Published This new feature has been published. and removed RTP Ready to publish labels Jul 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Published This new feature has been published.
Projects
None yet
Development

No branches or pull requests

2 participants