Package org.keycloak.services
Class ErrorResponse
java.lang.Object
org.keycloak.services.ErrorResponse
- Author:
- Stian Thorgersen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ErrorResponseExceptionstatic ErrorResponseExceptionstatic ErrorResponseExceptionerror(KeycloakSession session, String locale, ModelException me, jakarta.ws.rs.core.Response.Status status) Resolves the exception's message key using the admin theme messages and returns an error response with the localized message.static ErrorResponseExceptionerrors(List<ErrorRepresentation> s, jakarta.ws.rs.core.Response.Status status) static ErrorResponseExceptionerrors(List<ErrorRepresentation> s, jakarta.ws.rs.core.Response.Status status, boolean shrinkSingleError) static ErrorResponseExceptionstatic StringresolveMessage(KeycloakSession session, String locale, String messageKey, Object[] params) Resolves a message key from the admin theme messages, formatting it with the supplied parameters.
-
Constructor Details
-
ErrorResponse
public ErrorResponse()
-
-
Method Details
-
exists
-
error
public static ErrorResponseException error(String message, jakarta.ws.rs.core.Response.Status status) -
error
public static ErrorResponseException error(String message, Object[] params, jakarta.ws.rs.core.Response.Status status) -
error
public static ErrorResponseException error(KeycloakSession session, String locale, ModelException me, jakarta.ws.rs.core.Response.Status status) Resolves the exception's message key using the admin theme messages and returns an error response with the localized message. -
resolveMessage
public static String resolveMessage(KeycloakSession session, String locale, String messageKey, Object[] params) Resolves a message key from the admin theme messages, formatting it with the supplied parameters. If no translation is found, the key itself is returned as-is. -
errors
public static ErrorResponseException errors(List<ErrorRepresentation> s, jakarta.ws.rs.core.Response.Status status) -
errors
public static ErrorResponseException errors(List<ErrorRepresentation> s, jakarta.ws.rs.core.Response.Status status, boolean shrinkSingleError)
-