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

Looking for a way to handle error #26

Closed
lalith-b opened this issue Oct 11, 2013 · 1 comment · Fixed by #30
Closed

Looking for a way to handle error #26

lalith-b opened this issue Oct 11, 2013 · 1 comment · Fixed by #30

Comments

@lalith-b
Copy link

It could be great if there's a ErrorListener to check and handle errors. I'm in a situation where I could get Javascript/JS files along with images.

If the downsampler couldn't downsample it would be great if I could get a error listener.

10-11 14:01:28.096: W/System.err(9884): java.lang.IllegalArgumentException: IP: null result, sampleSize=1
10-11 14:01:28.106: W/System.err(9884):     at com.bumptech.glide.resize.load.Downsampler.decodeStream(Downsampler.java:184)
10-11 14:01:28.106: W/System.err(9884):     at com.bumptech.glide.resize.load.Downsampler.downsampleWithSize(Downsampler.java:114)
10-11 14:01:28.106: W/System.err(9884):     at com.bumptech.glide.resize.load.Downsampler.downsample(Downsampler.java:98)
10-11 14:01:28.106: W/System.err(9884):     at com.bumptech.glide.resize.load.ImageResizer.load(ImageResizer.java:113)
10-11 14:01:28.106: W/System.err(9884):     at com.bumptech.glide.resize.ImageManager$ImageManagerRunner.resizeIfNotFound(ImageManager.java:573)
10-11 14:01:28.106: W/System.err(9884):     at com.bumptech.glide.resize.ImageManager$ImageManagerRunner.access$1600(ImageManager.java:466)
10-11 14:01:28.106: W/System.err(9884):     at com.bumptech.glide.resize.ImageManager$ImageManagerRunner$1$1$1.run(ImageManager.java:554)
10-11 14:01:28.106: W/System.err(9884):     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
10-11 14:01:28.106: W/System.err(9884):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
10-11 14:01:28.106: W/System.err(9884):     at java.util.concurrent.FutureTask.run(FutureTask.java:137)
10-11 14:01:28.106: W/System.err(9884):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
10-11 14:01:28.106: W/System.err(9884):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
10-11 14:01:28.106: W/System.err(9884):     at java.lang.Thread.run(Thread.java:856)
@sjudd
Copy link
Collaborator

sjudd commented Oct 15, 2013

The case you mention can definitely occur, you will see something similar if you try to load a url and get a 404 for example.

I'll look in to adding an exception handler. There is one for ImagePresenters if you're using them directly: https://github.com/bumptech/glide/blob/master/library/src/com/bumptech/glide/presenter/ImagePresenter.java#L246

Out of curiosity, what would you want to do in the error listener/exception handler? Try loading the image again?

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

Successfully merging a pull request may close this issue.

2 participants