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

More declarative exceptions. #33

Open
Trikke opened this issue Oct 30, 2014 · 3 comments
Open

More declarative exceptions. #33

Trikke opened this issue Oct 30, 2014 · 3 comments

Comments

@Trikke
Copy link

Trikke commented Oct 30, 2014

Would it be possible to have a more descriptive exception on null objects or any exception detailing one of the objects being injected?

Currently i have an Activity with a large number of @icicles, and it's hard to find out which one is wrong once users report this error through Google Play.

java.lang.NullPointerException
at com.Activity$$Icicle.saveInstanceState(Activity$$Icicle.java:27)
at com.Activity$$Icicle.saveInstanceState(Activity$$Icicle.java:6)
at icepick.Action$1.invoke(Action.java:6)
at icepick.ObjectInjector.inject(ObjectInjector.java:16)
at icepick.Icepick.saveInstanceState(Icepick.java:17)
at 
@frankiesardo
Copy link
Owner

Could this be related to #31?

@Trikke
Copy link
Author

Trikke commented Oct 30, 2014

In a sense, yes. It would be nice if we can state what @icicles can be nullable. But I still think it's a good idea to be as descriptive as possible when throwing exceptions in a library which injects code.
Butterknife is a good example for this, if a View cannot be found, it throws an error stating the resource ID and field name. It would be nice if Icepick would let me know what @icicle it has troubles with.

@frankiesardo
Copy link
Owner

I suppose every statement could be wrapped in a try/catch block that will provide all the necessary info if it fails. Sounds useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants