server: fix the function 'createErrorResponse'
@@ -316,8 +316,7 @@ public class GenericRestWSServer implements IWSServer {
protected Response createErrorResponse(String method, String errorMessage) {
try {
logQuery(ERROR);
- return buildResponse(Response.ok(jsonObjectWriter.writeValueAsString(new HashMap<>().put("[ERROR] " + method, errorMessage)),
- MediaType.APPLICATION_JSON_TYPE));
+ return buildResponse(Response.ok(Collections.singletonMap("[ERROR] " + method, errorMessage), MediaType.APPLICATION_JSON_TYPE));
} catch (Exception e) {
return createErrorResponse(e);
}
