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

Change Exception to Throwable when Decoding #176

Closed
wants to merge 1 commit into from
Closed

Change Exception to Throwable when Decoding #176

wants to merge 1 commit into from

Conversation

Kennyc1012
Copy link

  • When decoding an image, any Exception is being caught. This will
    catch a large majority of crashes, except for one of the most important
    when dealing with Images, OutOfMemoryError. The Exception class
    extends Throwable, so it will still continue to catch what it did
    before.

- When decoding an image, any Exception is being caught. This will
catch a large majority of crashes, except for one of the most important
when dealing with Images, OutOfMemoryException. The Exception class
extends Throwable, so it will still continue to catch what it did
before.
@davemorrissey
Copy link
Owner

Generally the rule is never to catch Throwable because it leaves the JVM in an undefined state that may not be recoverable. I'm not certain whether this applies to the Dalvik/ART VMs for OutOfMemoryErrors, but given the goal of this view is to make OOMEs very unlikely I'm also not sure this a necessary change.

@davemorrissey
Copy link
Owner

I don't want to catch Throwable but catching OutOfMemoryError should be okay in almost all cases, so I'll close this PR and create an OutOfMemoryException class to wrap it, preserving backwards compatibility for the listener interface.

davemorrissey added a commit that referenced this pull request Apr 3, 2016
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.

2 participants