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 an exception handler to Glide requests #30

Merged
merged 2 commits into from
Nov 7, 2013

Conversation

sjudd
Copy link
Collaborator

@sjudd sjudd commented Oct 20, 2013

Fixes #26

@sjudd
Copy link
Collaborator Author

sjudd commented Oct 20, 2013

@deathlord87 If this looks ok to you, I'll merge it in. Let me know if you have any comments. Thanks!

@lalith-b
Copy link

lalith-b commented Nov 4, 2013

will all the requests from glide be added as a exception handling interface ?

*/
@Override
public int hashCode() {
throw new UnsupportedOperationException();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why throw an UnsupportedOperationException() ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be sure that I don't accidentally use the method somewhere. It's basically undefined behavior, these things shouldn't be used in hash maps unless someone explicitly adds an implementation for the method in a subclass.

@sjudd
Copy link
Collaborator Author

sjudd commented Nov 7, 2013

@deathlord87 It's a bit confusing, but this is not a global error/result listener. Instead it's linked to the given target. So for a given image view, as long as the arguments to glide do not change, the handler passed in will handle exceptions/completions for any loads into that image view.

Each request handler therefore may handle multiple loads, but there can be up to one handler per view/target.

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

Successfully merging this pull request may close these issues.

Looking for a way to handle error
2 participants