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

Add associated Data to ImagePipeline.Error.decodingFailed #545

Merged
merged 1 commit into from May 27, 2022

Conversation

freak4pc
Copy link
Contributor

Based on discussion at #544

@kean
Copy link
Owner

kean commented May 25, 2022

Could you please update the unit tests? If you run them locally, you'll see what the issues are.

@freak4pc
Copy link
Contributor Author

@kean my bad, I opened Package.swift directly and it doesn't have the tests targets :)
Fixed.

@kean kean merged commit 26bffb0 into kean:master May 27, 2022
@@ -68,7 +68,7 @@ final class TaskFetchDecodedImage: ImagePipelineTask<ImageResponse> {
if let response = response {
send(value: response, isCompleted: isCompleted)
} else if isCompleted {
send(error: .decodingFailed)
send(error: .decodingFailed(response?.container.data ?? Data()))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@freak4pc, I was reworking this code for Nuke 11 and just noticed that it never attaches data. In this code block response is always nil.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's interesting. So where would we be able fetching the "right" Data from?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll fix it in the patch release later today.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is that ImageResponse is always nil in this block – decoding failed.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 10.11.1.

@freak4pc freak4pc deleted the add-decoding-error branch June 9, 2022 06:01
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.

None yet

2 participants