stratos-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lahirus <...@git.apache.org>
Subject [GitHub] stratos pull request: Moving non api methods
Date Sun, 10 May 2015 02:56:52 GMT
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.
---

Mime
View raw message