Skip to content

Conversation

@kevinferrare-1a
Copy link

@kevinferrare-1a kevinferrare-1a commented Oct 27, 2025

Adds support for the always attribute in @UnwrapException annotation to force exception unwrapping even when exception mappers exist for parent types.

This makes tests in the reproducer pass:
https://github.com/user-attachments/files/20574949/quarkus-48197-reproducer.zip

Main Changes:

  • Added always boolean parameter to @UnwrapException annotation (default: false) and propagated it.

  • Updated RuntimeExceptionMapper exception mapping strategy to handle the always flag:

    • If always=true and exception is not directly mapped anywhere, unwrap
    • If always wasn't true or unwrapping didnt return anything, check if the exception or one of its subtypes is mapped (existing behaviour)
    • If exception still couldnt be mapped, unwrap it and repeat the process for the wrapped exception (existing behaviour)
  • Reworked UnwrappedExceptionTest to add more cases and more explicit names, and achieve 100% coverage on new code in RuntimeExceptionMapper.

  • Closes: UnwrapException ineffective when a subclass of the declared exception is mapped via ServerExceptionMapper #48197

@quarkus-bot

This comment has been minimized.

@kevinferrare-1a kevinferrare-1a changed the title Allow forcing exception unwrapping even when parent type mappers exist. Allow forcing exception unwrapping even when parent type mappers exist Oct 27, 2025
@kevinferrare-1a kevinferrare-1a force-pushed the feature/unwrap-exception-always branch from 56ef700 to a84b26d Compare October 27, 2025 09:35
@quarkus-bot

This comment has been minimized.

@github-actions
Copy link

github-actions bot commented Oct 27, 2025

🎊 PR Preview a8d372e has been successfully built and deployed to https://quarkus-pr-main-50730-preview.surge.sh/version/main/guides/

  • Images of blog posts older than 3 months are not available.
  • Newsletters older than 3 months are not available.

@quarkus-bot

This comment has been minimized.

@kevinferrare-1a kevinferrare-1a force-pushed the feature/unwrap-exception-always branch from a84b26d to d10b3c1 Compare October 27, 2025 17:26
@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

@kevinferrare-1a kevinferrare-1a force-pushed the feature/unwrap-exception-always branch from d10b3c1 to d2d9f1f Compare October 28, 2025 08:26
@quarkus-bot
Copy link

quarkus-bot bot commented Oct 28, 2025

Status for workflow Quarkus Documentation CI

This is the status report for running Quarkus Documentation CI on commit d2d9f1f.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

Warning

There are other workflow runs running, you probably need to wait for their status before merging.

@quarkus-bot
Copy link

quarkus-bot bot commented Oct 28, 2025

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit d2d9f1f.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.


Flaky tests - Develocity

⚙️ JVM Tests - JDK 17 Windows

📦 extensions/security-jpa/deployment

io.quarkus.security.jpa.FormAuthJpaTestCase.testFormBasedAuthSuccess - History

  • 1 expectation failed. Expected status code <200> but was <302>. - java.lang.AssertionError
java.lang.AssertionError: 
1 expectation failed.
Expected status code <200> but was <302>.

	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)

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.

UnwrapException ineffective when a subclass of the declared exception is mapped via ServerExceptionMapper

1 participant