/** * Turn an exception into a proper error response from patch extension. */ private void throwErrorResponse() { ObjectNode errorContainer = getErrorContainer(); ArrayNode errorList = (ArrayNode) errorContainer.get("errors"); boolean failed = false; for (PatchAction action : actions) { failed = processAction(errorList, failed, action); } throw new JsonPatchExtensionException(HttpStatus.SC_BAD_REQUEST, errorContainer); }
return buildResponse(e.getResponse());
return buildResponse(e.getResponse());
/** * Turn an exception into a proper error response from patch extension. */ private void throwErrorResponse() { ObjectNode errorContainer = getErrorContainer(); ArrayNode errorList = (ArrayNode) errorContainer.get("errors"); boolean failed = false; for (PatchAction action : actions) { failed = processAction(errorList, failed, action); } throw new JsonPatchExtensionException(HttpStatus.SC_BAD_REQUEST, errorContainer); }