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

.load("") error message is confusing (empty string) #415

Closed
TWiStErRob opened this issue Apr 15, 2015 · 0 comments
Closed

.load("") error message is confusing (empty string) #415

TWiStErRob opened this issue Apr 15, 2015 · 0 comments
Milestone

Comments

@TWiStErRob
Copy link
Collaborator

Glide Version/Integration library (if any): 3.5.2
Device/Android Version: S4/4.4
Issue details/Repro steps: I found this one while working on #396. The error reported when handing Glide a "" to load is extremely confusing. Somehow Glide manages to acquire a ParcelFileDescriptor for "" which obviosly can't be opened. I'm guessing there's a catch-all else branch somewhere creating a ParcelFileDescriptor when parsing as anything else fails.

The same exception is displayed through log.tag.GenericRequest.

The URL String was acquired from a utility method like this (generalized):

String findUrl(params) {
    if (isValid(params)) {
        return generateUrl(params);
    } else {
        return "";
    }
}

An obvious workaround here is to return null, but it would help to have better message for those new to Glide (and experienced users too, I was puzzled for a few minutes too).

Glide load line:

Glide.with(context)
     //.fromString() // optional, doesn't change a thing
     //.asBitmap() // only changes stacktrace slightly
     //.error(R.drawable.error) // displays correctly if provided
     .load("")
     .into(imageView)
;

Stack trace (with .asBitmap()):

04-15 13:39:50.500    1364-1364/net.twisterrob.app D/GLIDE﹕ onException(java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA, , Target for: android.widget.ImageView{42a97688 V.ED.... ......ID 0,0-150,150 #7f090023 app:id/image}, true)
    java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA
            at android.media.MediaMetadataRetriever.setDataSource(Native Method)
            at android.media.MediaMetadataRetriever.setDataSource(MediaMetadataRetriever.java:138)
            at com.bumptech.glide.load.resource.bitmap.VideoBitmapDecoder.decode(VideoBitmapDecoder.java:46)
            at com.bumptech.glide.load.resource.bitmap.FileDescriptorBitmapDecoder.decode(FileDescriptorBitmapDecoder.java:45)
            at com.bumptech.glide.load.resource.bitmap.FileDescriptorBitmapDecoder.decode(FileDescriptorBitmapDecoder.java:19)
            at com.bumptech.glide.load.resource.bitmap.ImageVideoBitmapDecoder.decode(ImageVideoBitmapDecoder.java:50)
            at com.bumptech.glide.load.resource.bitmap.ImageVideoBitmapDecoder.decode(ImageVideoBitmapDecoder.java:20)
            at com.bumptech.glide.load.engine.DecodeJob.decodeFromSourceData(DecodeJob.java:190)
            at com.bumptech.glide.load.engine.DecodeJob.decodeSource(DecodeJob.java:177)
            at com.bumptech.glide.load.engine.DecodeJob.decodeFromSource(DecodeJob.java:128)
            at com.bumptech.glide.load.engine.EngineRunnable.decodeFromSource(EngineRunnable.java:122)
            at com.bumptech.glide.load.engine.EngineRunnable.decode(EngineRunnable.java:101)
            at com.bumptech.glide.load.engine.EngineRunnable.run(EngineRunnable.java:58)
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
            at java.util.concurrent.FutureTask.run(FutureTask.java:237)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            at java.lang.Thread.run(Thread.java:841)
            at com.bumptech.glide.load.engine.executor.FifoPriorityThreadPoolExecutor$DefaultThreadFactory$1.run(FifoPriorityThreadPoolExecutor.java:52)
@sjudd sjudd added this to the 3.6.0 milestone Apr 15, 2015
@sjudd sjudd closed this as completed in 248bca9 Apr 16, 2015
@TWiStErRob TWiStErRob changed the title .load("") error message is confusing .load("") error message is confusing (empty string) Mar 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants