Call super constructor in subclasses of WebApplicationException

Frameworks like Datadog dd-trace-java java agent inspect the known WebApplicationException
and mark the exception as an HTTP 500, because that is the default for the
non argument constructor.

https://github.com/keycloak/keycloak/issues/29451

Signed-off-by: Filipe Roque <froque@premium-minds.com>
This commit is contained in:
Filipe Roque 2024-05-17 14:12:15 +01:00 committed by Alexander Schwartz
parent 1aab371912
commit e83f3af080
3 changed files with 3 additions and 0 deletions

View file

@ -35,6 +35,7 @@ public class CorsErrorResponseException extends WebApplicationException {
private final Response.Status status;
public CorsErrorResponseException(Cors cors, String error, String errorDescription, Response.Status status) {
super(error, status);
this.cors = cors;
this.error = error;
this.errorDescription = errorDescription;

View file

@ -36,6 +36,7 @@ public class ErrorPageException extends WebApplicationException {
public ErrorPageException(KeycloakSession session, Response.Status status, String errorMessage, Object... parameters) {
super(errorMessage, status);
this.session = session;
this.status = status;
this.errorMessage = errorMessage;

View file

@ -36,6 +36,7 @@ public class ErrorResponseException extends WebApplicationException {
private final Response.Status status;
public ErrorResponseException(String error, String errorDescription, Response.Status status) {
super(error, status);
this.response = null;
this.error = error;
this.errorDescription = errorDescription;