public static void addErrorMessageToContext(final RequestContext requestContext, final String code,
                                                final String defaultText) {
        addErrorMessageToContext(requestContext.getMessageContext(), code, defaultText, ArrayUtils.EMPTY_OBJECT_ARRAY);
    }
Add error message to context.

@param requestContext the request context
@param code           the code
@param defaultText    the default text
core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java