Source:
<code>public static void updateTenantConfigBean(HttpServletRequest request, ServletConfig config, HttpSession session) throws Exception { TenantInfoBean tenantInfoBean = new TenantInfoBean(); try { String tenantIdStr = request.getParameter("tenantId"); int tenantId; try { tenantId = Integer.parseInt(tenantIdStr); } catch (Exception e) { String msg = "Error in converting tenant id: " + tenantIdStr + " to a number."; log.error(msg); throw new Exception(msg, e); } tenantInfoBean.setTenantId(tenantId); tenantInfoBean.setAdmin(request.getParameter("admin")); tenantInfoBean.setFirstname(request.getParameter("admin-firstname")); tenantInfoBean.setLastname(request.getParameter("admin-lastname")); tenantInfoBean.setAdminPassword(request.getParameter("admin-password")); tenantInfoBean.setTenantDomain(request.getParameter("domain")); tenantInfoBean.setEmail(request.getParameter("admin-email")); tenantInfoBean.setUsagePlan(request.getParameter("usage-plan-name")); String enableEmailUserName = ServerConfiguration.getInstance().getFirstProperty("EnableEmailUserName"); if (enableEmailUserName != null && enableEmailUserName.equalsIgnoreCase("true")){ tenantInfoBean.setEmail(tenantInfoBean.getAdmin()); } TenantServiceClient serviceClient = new TenantServiceClient(config, session); serviceClient.updateTenant(tenantInfoBean); } catch (Exception e) { <START> String msg = "Failed to update the tenant domain '" + tenantInfoBean.getTenantDomain() + "'."; <END> String rootCause = ((TenantMgtAdminServiceExceptionException) e).getFaultMessage(). getTenantMgtAdminServiceException().getMessage(); if (rootCause != null && !rootCause.isEmpty()) { msg = msg + " Root cause : " + rootCause; } else { msg = msg + " Root cause is not available."; } log.error(msg, e); throw new Exception(msg, e); } }</code><technical_language>scenarios throw exception other failure update tenant domain? Original error is this</technical_language>

Target:
public static void updateTenantConfigBean(HttpServletRequest request, ServletConfig config, HttpSession session) throws Exception { TenantInfoBean tenantInfoBean = new TenantInfoBean(); try { String tenantIdStr = request.getParameter("tenantId"); int tenantId; try { tenantId = Integer.parseInt(tenantIdStr); } catch (Exception e) { String msg = "Error in converting tenant id: " + tenantIdStr + " to a number."; log.error(msg); throw new Exception(msg, e); } tenantInfoBean.setTenantId(tenantId); tenantInfoBean.setAdmin(request.getParameter("admin")); tenantInfoBean.setFirstname(request.getParameter("admin-firstname")); tenantInfoBean.setLastname(request.getParameter("admin-lastname")); tenantInfoBean.setAdminPassword(request.getParameter("admin-password")); tenantInfoBean.setTenantDomain(request.getParameter("domain")); tenantInfoBean.setEmail(request.getParameter("admin-email")); tenantInfoBean.setUsagePlan(request.getParameter("usage-plan-name")); String enableEmailUserName = ServerConfiguration.getInstance().getFirstProperty("EnableEmailUserName"); if (enableEmailUserName != null && enableEmailUserName.equalsIgnoreCase("true")){ tenantInfoBean.setEmail(tenantInfoBean.getAdmin()); } TenantServiceClient serviceClient = new TenantServiceClient(config, session); serviceClient.updateTenant(tenantInfoBean); } catch (Exception e) { String msg = "Failed to update the tenant '" + tenantInfoBean.getTenantDomain() + "'."; String rootCause = ((TenantMgtAdminServiceExceptionException) e).getFaultMessage(). getTenantMgtAdminServiceException().getMessage(); if (rootCause != null && !rootCause.isEmpty()) { msg = msg + " Root cause : " + rootCause; } else { msg = msg + " Root cause is not available."; } log.error(msg, e); throw new Exception(msg, e); } }