Source:
<code>protected AuthenticationContext initializeFlow(HttpServletRequest request, HttpServletResponse response) throws FrameworkException { if (log.isDebugEnabled()) { log.debug("Initializing the flow"); } String callerSessionDataKey = request.getParameter(FrameworkConstants.SESSION_DATA_KEY); String callerPath = getCallerPath(request); String requestType = request.getParameter(FrameworkConstants.RequestParams.TYPE); String relyingParty = request.getParameter(FrameworkConstants.RequestParams.ISSUER); String tenantDomain = getTenantDomain(request); AuthenticationContext context = new AuthenticationContext(); context.setCallerSessionKey(callerSessionDataKey); context.setCallerPath(callerPath); context.setRequestType(requestType); try { context.setRelyingParty(URLEncoder.encode(relyingParty, "UTF-8")); } catch (UnsupportedEncodingException e) { <START> throw new FrameworkException(e.getMessage(), e); <END> } context.setTenantDomain(tenantDomain); String contextId = UUIDGenerator.generateUUID(); context.setContextIdentifier(contextId); if (log.isDebugEnabled()) { log.debug("Framework contextId: " + contextId); } if (request.getParameter(FrameworkConstants.RequestParams.LOGOUT) != null) { if (log.isDebugEnabled()) { log.debug("Starting a logout flow"); } context.setLogoutRequest(true); if (context.getRelyingParty() == null || context.getRelyingParty().trim().length() == 0) { if (log.isDebugEnabled()) { log.debug("relyingParty param is null. This is a possible logout scenario."); } Cookie cookie = FrameworkUtils.getAuthCookie(request); if (cookie != null) { context.setSessionIdentifier(cookie.getValue()); } return context; } } else { if (log.isDebugEnabled()) { log.debug("Starting an authentication flow"); } } findPreviousAuthenticatedSession(request, context); buildOutboundQueryString(request, context); return context; }</code><technical_language>Is add more contextual error message</technical_language>

Target:
protected AuthenticationContext initializeFlow(HttpServletRequest request, HttpServletResponse response) throws FrameworkException { if (log.isDebugEnabled()) { log.debug("Initializing the flow"); } String callerSessionDataKey = request.getParameter(FrameworkConstants.SESSION_DATA_KEY); String callerPath = getCallerPath(request); String requestType = request.getParameter(FrameworkConstants.RequestParams.TYPE); String relyingParty = request.getParameter(FrameworkConstants.RequestParams.ISSUER); String tenantDomain = getTenantDomain(request); AuthenticationContext context = new AuthenticationContext(); context.setCallerSessionKey(callerSessionDataKey); context.setCallerPath(callerPath); context.setRequestType(requestType); context.setRelyingParty(relyingParty); context.setTenantDomain(tenantDomain); String contextId = UUIDGenerator.generateUUID(); context.setContextIdentifier(contextId); if (log.isDebugEnabled()) { log.debug("Framework contextId: " + contextId); } if (request.getParameter(FrameworkConstants.RequestParams.LOGOUT) != null) { if (log.isDebugEnabled()) { log.debug("Starting a logout flow"); } context.setLogoutRequest(true); if (context.getRelyingParty() == null || context.getRelyingParty().trim().length() == 0) { if (log.isDebugEnabled()) { log.debug("relyingParty param is null. This is a possible logout scenario."); } Cookie cookie = FrameworkUtils.getAuthCookie(request); if (cookie != null) { context.setSessionIdentifier(cookie.getValue()); } return context; } } else { if (log.isDebugEnabled()) { log.debug("Starting an authentication flow"); } } findPreviousAuthenticatedSession(request, context); buildOutboundQueryString(request, context); return context; }