Skip to content

Add associated Data to ImagePipeline.Error.decodingFailed#545

Merged
kean merged 1 commit into
kean:masterfrom
freak4pc:add-decoding-error
May 27, 2022
Merged

Add associated Data to ImagePipeline.Error.decodingFailed#545
kean merged 1 commit into
kean:masterfrom
freak4pc:add-decoding-error

Conversation

@freak4pc

Copy link
Copy Markdown
Contributor

Based on discussion at #544

@kean

kean commented May 25, 2022

Copy link
Copy Markdown
Owner

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

@freak4pc freak4pc force-pushed the add-decoding-error branch from 193d544 to 90d72cc Compare May 25, 2022 20:01
@freak4pc

Copy link
Copy Markdown
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
send(value: response, isCompleted: isCompleted)
} else if isCompleted {
send(error: .decodingFailed)
send(error: .decodingFailed(response?.container.data ?? Data()))

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

2 participants