Picasso doesn't write exceptions to stacktrace #1548

Closed
soberowy opened this Issue Dec 7, 2016 · 2 comments

Projects

None yet

2 participants

@soberowy
soberowy commented Dec 7, 2016

I stumbled upon quite of a minor issue in Picasso. I am loading images from storage to Target using Picasso and I didn't have READ_EXTERNAL_STORAGE permission in my manifest so I got a SecurityException caught in BitmapHunter (I know that it should be obvious to turn on the permission but I just forgot about it). I had to debug quite a lot to get into it because even with logging enabled Picasso didn't show me the stacktrace. I strongly suggest to change it in the upcoming versions.

That kind of logging doesn't tell me much about the problem:

D/Picasso: Main        created      [R0] Request{content://media/external/images/media/1623}
D/Picasso: Dispatcher  enqueued     [R0]+7ms 
D/Picasso: Hunter      executing    [R0]+7ms 
D/Picasso: Dispatcher  batched      [R0]+42ms for error
D/Picasso: Dispatcher  delivered    [R0]+244ms 
D/Picasso: Main        errored      [R0]+244ms 
@soberowy
soberowy commented Dec 7, 2016

Until this is fixed here is a workaround for it

Picasso picasso = new Picasso.Builder(context).listener(new Picasso.Listener() {
    @Override
    public void onImageLoadFailed(Picasso picasso, Uri uri, Exception exception) {
        exception.printStackTrace();
    }
}).build();
picasso.load(uri).into(target);
@JakeWharton
Member

That is the intended way of logging full errors. I've added the exception message to the logging output though, which should at least give some indication.

@JakeWharton JakeWharton closed this in #1569 Jan 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment