moxy-community / Moxy

Moxy is MVP library for Android with incremental annotation processor and ktx features
MIT License
324 stars 33 forks source link

Rethrow exceptions in ViewStateLocator #107

Closed Svechnikov closed 4 years ago

Svechnikov commented 4 years ago

Consider this situation:

  1. MvpPresenter.Binder.bind calls ViewStateLocator.getViewState
  2. Inside ViewStateLocator.getViewState a call to Class.forName for some reason raises an exception
  3. ViewStateLocator.getViewState silently consumes this exception and returns null
  4. Later on we get NPE when calling something like viewState.showMessage() in presenter. The reason for NPE is unclear and difficult to debug.

I propose not to silently consume exception.