public static ModelAndView writeError(final HttpServletResponse response, final String error) {
        return writeError(response, error, null);
    }
Write to the output this error.

@param response the response
@param error    error message
@return json -backed view.
support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/util/OAuth20Utils.java