Skip to content

Commit c4ef710

Browse files
committed
Sync documentation of main branch
1 parent 5224a26 commit c4ef710

File tree

5 files changed

+39
-4
lines changed

5 files changed

+39
-4
lines changed

_generated-doc/main/config/quarkus-agroal.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ Environment variable: `+++QUARKUS_DATASOURCE_JDBC_METRICS_ENABLED+++`
221221
endif::add-copy-button-to-env-var[]
222222
--
223223
|boolean
224-
|`+++false+++`
224+
|
225225

226226
a| [[quarkus-agroal_quarkus-datasource-jdbc-url]] [.property-path]##link:#quarkus-agroal_quarkus-datasource-jdbc-url[`quarkus.datasource.jdbc.url`]##
227227
ifdef::add-copy-button-to-config-props[]

_generated-doc/main/config/quarkus-agroal_quarkus.datasource.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ Environment variable: `+++QUARKUS_DATASOURCE_JDBC_METRICS_ENABLED+++`
221221
endif::add-copy-button-to-env-var[]
222222
--
223223
|boolean
224-
|`+++false+++`
224+
|
225225

226226
a| [[quarkus-agroal_quarkus-datasource-jdbc-url]] [.property-path]##link:#quarkus-agroal_quarkus-datasource-jdbc-url[`quarkus.datasource.jdbc.url`]##
227227
ifdef::add-copy-button-to-config-props[]

_generated-doc/main/config/quarkus-all-config.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ Environment variable: `+++QUARKUS_DATASOURCE_JDBC_METRICS_ENABLED+++`
221221
endif::add-copy-button-to-env-var[]
222222
--
223223
|boolean
224-
|`+++false+++`
224+
|
225225

226226
a| [[quarkus-agroal_quarkus-datasource-jdbc-url]] [.property-path]##link:#quarkus-agroal_quarkus-datasource-jdbc-url[`quarkus.datasource.jdbc.url`]##
227227
ifdef::add-copy-button-to-config-props[]

_generated-doc/main/infra/quarkus-all-build-items.adoc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7793,11 +7793,16 @@ _No Javadoc found_
77937793
a| https://github.com/quarkusio/quarkus/blob/main/extensions/resteasy-reactive/rest/spi-deployment/src/main/java/io/quarkus/resteasy/reactive/server/spi/UnwrappedExceptionBuildItem.java[`io.quarkus.resteasy.reactive.server.spi.UnwrappedExceptionBuildItem`, window="_blank"]
77947794
[.description]
77957795
--
7796-
When an `Exception` of this type is thrown and no `jakarta.ws.rs.ext.ExceptionMapper` exists, then RESTEasy Reactive will attempt to locate an `ExceptionMapper` for the cause of the Exception.
7796+
When an `Exception` of this type is thrown and no `jakarta.ws.rs.ext.ExceptionMapper` exists, then RESTEasy Reactive will attempt to locate an `ExceptionMapper` for the cause of the Exception.
7797+
The unwrapping behavior is controlled by the `ExceptionUnwrapStrategy` .
77977798
-- a|`java.lang.String throwableClassName`
77987799
77997800
_No Javadoc found_
78007801

7802+
`org.jboss.resteasy.reactive.server.ExceptionUnwrapStrategy strategy`
7803+
7804+
_No Javadoc found_
7805+
78017806

78027807
|===
78037808
== REST - SPI

_versions/main/guides/rest.adoc

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2422,6 +2422,36 @@ public class Mapper {
24222422
24232423
}
24242424
----
2425+
2426+
By default, `@UnwrapException` only unwraps exceptions when no exception mapper exists for the wrapper exception or its parent types.
2427+
You can control the unwrapping behavior using the `strategy` attribute with one of the following values:
2428+
2429+
* `ExceptionUnwrapStrategy.UNWRAP_IF_NO_MATCH` (default): Unwraps only if neither the thrown exception nor any of its supertypes have a registered mapper. Checks the entire type hierarchy before unwrapping.
2430+
* `ExceptionUnwrapStrategy.UNWRAP_IF_NO_EXACT_MATCH`: Unwraps if the thrown exception type itself has no exact mapper registered. Checks for an exact match first, then unwraps if none is found.
2431+
* `ExceptionUnwrapStrategy.ALWAYS`: Always unwraps exception before checking mappers. Only falls back to checking mappers for the wrapper exception if no mapper is found for any unwrapped cause.
2432+
2433+
[source,java]
2434+
----
2435+
@UnwrapException(value = {WebApplicationException.class}, strategy = ExceptionUnwrapStrategy.UNWRAP_IF_NO_EXACT_MATCH)
2436+
public class Mappers {
2437+
2438+
@ServerExceptionMapper
2439+
public Response handleRuntimeException(RuntimeException ex) {
2440+
// Handles RuntimeException and its subclasses
2441+
return Response.status(599).build();
2442+
}
2443+
2444+
@ServerExceptionMapper
2445+
public Response handleJsonProcessingException(JsonProcessingException ex) {
2446+
// This will be called for JsonProcessingException wrapped in WebApplicationException
2447+
// because UNWRAP_IF_NO_EXACT_MATCH forces unwrapping even though RuntimeException mapper that would match WebApplicationException exists
2448+
return Response.status(400).entity("Invalid JSON").build();
2449+
}
2450+
2451+
}
2452+
----
2453+
2454+
This is useful when you have a general exception mapper for a parent type (like `RuntimeException`) but want to handle specific wrapped exceptions differently.
24252455
====
24262456

24272457
[NOTE]

0 commit comments

Comments
 (0)