Search in sources :

Example 21 with ErrorRepresentation

use of org.keycloak.representations.idm.ErrorRepresentation in project keycloak by keycloak.

the class ErrorResponse method error.

public static Response error(String message, Object[] params, Response.Status status) {
    ErrorRepresentation error = new ErrorRepresentation();
    error.setErrorMessage(message);
    error.setParams(params);
    return Response.status(status).entity(error).type(MediaType.APPLICATION_JSON).build();
}
Also used : ErrorRepresentation(org.keycloak.representations.idm.ErrorRepresentation)

Aggregations

ErrorRepresentation (org.keycloak.representations.idm.ErrorRepresentation)21 Test (org.junit.Test)14 Response (javax.ws.rs.core.Response)11 UserRepresentation (org.keycloak.representations.idm.UserRepresentation)11 ClientErrorException (javax.ws.rs.ClientErrorException)7 UserResource (org.keycloak.admin.client.resource.UserResource)5 AuthServerContainerExclude (org.keycloak.testsuite.arquillian.annotation.AuthServerContainerExclude)5 LinkedList (java.util.LinkedList)4 IOException (java.io.IOException)3 List (java.util.List)3 ByteArrayInputStream (java.io.ByteArrayInputStream)2 URI (java.net.URI)2 URISyntaxException (java.net.URISyntaxException)2 URL (java.net.URL)2 Charset (java.nio.charset.Charset)2 Files (java.nio.file.Files)2 Paths (java.nio.file.Paths)2 Arrays (java.util.Arrays)2 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2