Skip to content

Conversation

@xxxyyyz
Copy link
Contributor

@xxxyyyz xxxyyyz commented Dec 18, 2025

Description

Throw an AS2DecryptionException when an entity contains an unsupported content type.
EntityParser::parseEntityBody currently returns null when the entity content type is not explicitly handled by one of the switch cases. This leads to a NullPointerException when the caller does not check the response for null values (e.g. in method parseMultipartSignedEntityBody).
The pull request throws an exception of type AS2DecryptionException allows the error to propagate the calling stack, leading to a helpful response message.

Target

  • I checked that the commit is targeting the correct branch (Camel 4 uses the main branch)

Tracking

  • If this is a large change, bug fix, or code improvement, I checked there is a JIRA issue filed for the change (usually before you start working on it).

Apache Camel coding standards and style

  • I checked that each commit in the pull request has a meaningful subject line and body.
  • I have run mvn clean install -DskipTests locally from root folder and I have committed all auto-generated changes.

@github-actions
Copy link
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟

🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run

  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot.

  • You can label PRs using build-all, build-dependents, skip-tests and test-dependents to fine-tune the checks executed by this PR.

  • Build and test logs are available in the Summary page. Only Apache Camel committers have access to the summary.

  • ⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@xxxyyyz xxxyyyz changed the title Exception on unsupported content type CAMEL-22737 Exception on unsupported content type Dec 18, 2025
@davsclaus davsclaus force-pushed the CAMEL-22737-exception-for-unsupported-entity-mime-type branch from 3b91db6 to 83bcfe7 Compare December 18, 2025 09:38
@davsclaus davsclaus force-pushed the CAMEL-22737-exception-for-unsupported-entity-mime-type branch from 83bcfe7 to cf5d42d Compare December 18, 2025 12:22
@davsclaus davsclaus merged commit 98fa1c7 into apache:main Dec 18, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants