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

Correctly throw ErrorDataDecoderException for errors while decoding #11198

Merged
merged 1 commit into from Apr 27, 2021

Conversation

normanmaurer
Copy link
Member

Motivation:

We didn't correctly handle the case when no content-type header was found or if the charset was illegal and just did throw a NPE or ICE. We should in both cases throw an ErrorDataDecoderException to reflect what is documented in the javadocs.

Modifications:

  • Throw correct exception
  • Merge private method into the constructor as it is only used there
  • Add unit tests

Result:

Throw expected exceptions on decoding errors

Motivation:

We didn't correctly handle the case when no content-type header was found or if the charset was illegal and just did throw a NPE or ICE. We should in both cases throw an ErrorDataDecoderException to reflect what is documented in the javadocs.

Modifications:

- Throw correct exception
- Merge private method into the constructor as it is only used there
- Add unit tests

Result:

Throw expected exceptions on decoding errors
Copy link
Member

@fredericBregier fredericBregier left a comment

Choose a reason for hiding this comment

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

Only a comment, not mandatory (related to another issue)

@normanmaurer
Copy link
Member Author

@fredericBregier yes but I wanted to keep this as a separate fix as it's not related

@normanmaurer normanmaurer merged commit 3657805 into 4.1 Apr 27, 2021
@normanmaurer normanmaurer deleted the multipart_exceptions branch April 27, 2021 14:37
normanmaurer added a commit that referenced this pull request Apr 27, 2021
…11198)

Motivation:

We didn't correctly handle the case when no content-type header was found or if the charset was illegal and just did throw a NPE or ICE. We should in both cases throw an ErrorDataDecoderException to reflect what is documented in the javadocs.

Modifications:

- Throw correct exception
- Merge private method into the constructor as it is only used there
- Add unit tests

Result:

Throw expected exceptions on decoding errors
raidyue pushed a commit to raidyue/netty that referenced this pull request Jul 8, 2022
…etty#11198)

Motivation:

We didn't correctly handle the case when no content-type header was found or if the charset was illegal and just did throw a NPE or ICE. We should in both cases throw an ErrorDataDecoderException to reflect what is documented in the javadocs.

Modifications:

- Throw correct exception
- Merge private method into the constructor as it is only used there
- Add unit tests

Result:

Throw expected exceptions on decoding errors
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