Github user swgkg commented on a diff in the pull request: https://github.com/apache/stratos/pull/298#discussion_r30002470 --- Diff: components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java --- @@ -2836,52 +2838,58 @@ public static void updateExistingTenant(org.apache.stratos.common.beans.TenantIn } catch (UserStoreException e) { String msg = "Error in retrieving the tenant id for the tenant domain: " + tenantDomain + "."; log.error(msg, e); - throw new Exception(msg, e); + throw new RestAPIException(msg, e); } Tenant tenant; try { tenant = (Tenant) tenantManager.getTenant(tenantId); } catch (UserStoreException e) { - String msg = "Error in retrieving the tenant id for the tenant domain: " + - tenantDomain + "."; + String msg = "Error in retrieving the tenant from tenant id: " + + tenantId + "."; log.error(msg, e); - throw new TenantNotFoundException(msg, e); + throw new RestAPIException(msg, e); } // filling the first and last name values - if (tenantInfoBean.getFirstname() != null && !tenantInfoBean.getFirstname().trim().equals("")) { + if (StringUtils.isBlank(tenantInfoBean.getFirstname())) { try { CommonUtil.validateName(tenantInfoBean.getFirstname(), "First Name"); } catch (Exception e) { --- End diff -- Better to catch with the specific exceptions rather than catching whole exception
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---