Return-Path: X-Original-To: apmail-stratos-dev-archive@minotaur.apache.org Delivered-To: apmail-stratos-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9610210AD6 for ; Sun, 10 May 2015 02:56:58 +0000 (UTC) Received: (qmail 31428 invoked by uid 500); 10 May 2015 02:56:53 -0000 Delivered-To: apmail-stratos-dev-archive@stratos.apache.org Received: (qmail 31371 invoked by uid 500); 10 May 2015 02:56:53 -0000 Mailing-List: contact dev-help@stratos.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stratos.apache.org Delivered-To: mailing list dev@stratos.apache.org Received: (qmail 31361 invoked by uid 99); 10 May 2015 02:56:52 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 10 May 2015 02:56:52 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B207AE0544; Sun, 10 May 2015 02:56:52 +0000 (UTC) From: lahirus To: dev@stratos.apache.org Reply-To: dev@stratos.apache.org References: In-Reply-To: Subject: [GitHub] stratos pull request: Moving non api methods Content-Type: text/plain Message-Id: <20150510025652.B207AE0544@git1-us-west.apache.org> Date: Sun, 10 May 2015 02:56:52 +0000 (UTC) Github user lahirus commented on a diff in the pull request: https://github.com/apache/stratos/pull/298#discussion_r29998276 --- 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) { String msg = "Invalid first name is provided."; log.error(msg, e); - throw new Exception(msg, e); + throw new RestAPIException(msg, e); } } - if (tenantInfoBean.getLastname() != null && !tenantInfoBean.getLastname().trim().equals("")) { + if (StringUtils.isBlank(tenantInfoBean.getLastname())) { try { CommonUtil.validateName(tenantInfoBean.getLastname(), "Last Name"); } catch (Exception e) { String msg = "Invalid last name is provided."; log.error(msg, e); - throw new Exception(msg, e); + throw new RestAPIException(msg, e); --- End diff -- Thold be handled with a specific exception, not with RestAPIException --- 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 infrastructure@apache.org or file a JIRA ticket with INFRA. ---