Package org.keycloak.services
Class RollbackWebApplicationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
jakarta.ws.rs.WebApplicationException
org.keycloak.services.RollbackWebApplicationException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
CorsErrorResponseException,ErrorPageException,ErrorResponseException
public abstract class RollbackWebApplicationException
extends jakarta.ws.rs.WebApplicationException
Base class for all Keycloak error exceptions that should roll back the current transaction.
Calling getResponse() with a non-null result (containing an entity) leads to RESTEasy
directly returning that response instead of propagating the exception to
KeycloakErrorHandler.toResponse(Throwable), which would normally ensure rollback.
This base class ensures setRollbackOnly() is always called before the error response
is returned.
Subclasses must override createErrorResponse() instead of getResponse().
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRollbackWebApplicationException(String message, jakarta.ws.rs.core.Response response) protectedRollbackWebApplicationException(String message, jakarta.ws.rs.core.Response.Status status) protectedRollbackWebApplicationException(Throwable cause, jakarta.ws.rs.core.Response response) -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.ResponseBuilds the error response.protected jakarta.ws.rs.core.Responsefinal jakarta.ws.rs.core.ResponseMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
RollbackWebApplicationException
protected RollbackWebApplicationException(String message, jakarta.ws.rs.core.Response.Status status) -
RollbackWebApplicationException
-
RollbackWebApplicationException
-
-
Method Details
-
getResponse
public final jakarta.ws.rs.core.Response getResponse()- Overrides:
getResponsein classjakarta.ws.rs.WebApplicationException
-
getOriginalResponse
protected jakarta.ws.rs.core.Response getOriginalResponse() -
createErrorResponse
public jakarta.ws.rs.core.Response createErrorResponse()Builds the error response. Override this instead ofgetResponse().
-