-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
Missing error handling for Errors #435
Labels
Comments
On a related note, if you include compile 'com.github.bumptech.glide:okhttp-integration:1.2.2@aar' but don't include
|
I have had the same problem with compile 'com.github.bumptech.glide:okhttp-integration:1.3.1@aar' adding is the current solution |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Glide Version/Integration library (if any): 3.6.0-SNAPSHOT / okhttp-1.3.0-SNAPSHOT
Device/Android Version: S4/4.4
Issue details: Runnables running in pools or just Threads don't have error handling and silently fail. This means that
EngineRunnable.run
is unguarded. There's no exception logged and even the the internalEngineRunnable.onLoadFailed
is missing a call, so the.error()
drawable is not set, nor any result. It was really weird to debug the code, because the only thing I experienced is thatfetcher.loadData
inDecodeJob.decodeSource
throws something (I know this because it jumped tofinally
), but there was no way to find out what.Over the years I learned to writing a
Runnable
by starting withtry {} catch(Throwable t) {}
, because otherwise I'll never be notified of the problems I may have during development, neither it is healthy to let those escape scope and become unreported.FifoPriorityThreadPoolExecutor
also just callsrun
so the only way to catch these is escapedRuntimeException
s/Error
s isThread.set(Default)UncaughtExceptionHandler
. I think the library should catch those in one way or another and report them through the usual paths.Repro steps: Add the following dependencies to the project and run any http image load:
The important thing is to NOT add
okio-1.3.0.jar
to the classpath, or just exclude it (untested, I was using the libs folder):Suggested fix: the only way I was able to figure out what's happening is by adding:
to
EngineRunnable.run
. TheonException
interface and others can't handleThrowable
s so theError
s may need to be wrapped inUncaughtErrorException
or similar, or just caught and logged.Stack trace:
This was what I got when I modified the Glide sources to log:
The text was updated successfully, but these errors were encountered: