You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stratos.apache.org by anuruddhal <gi...@git.apache.org> on 2015/07/28 07:23:32 UTC

[GitHub] stratos pull request: Fixing formatting issues and error messages

GitHub user anuruddhal opened a pull request:

    https://github.com/apache/stratos/pull/405

    Fixing formatting issues and error messages

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/anuruddhal/stratos master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/stratos/pull/405.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #405
    
----
commit b8b1c9c13696d1b8164cb4b20bff806743e599be
Author: anuruddhal <an...@gmail.com>
Date:   2015-07-28T05:05:57Z

    Fixing formatting issues

commit 31dbd6202a0fc9f0903335e7a27dd8f5d999a34f
Author: anuruddhal <an...@gmail.com>
Date:   2015-07-28T05:09:37Z

    Correcting error messages

commit ef743aab2e8af10892a72055aeec575425700b75
Author: anuruddhal <an...@gmail.com>
Date:   2015-07-28T05:16:08Z

    Adding error messages

----


---
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.
---

[GitHub] stratos pull request: Fixing formatting issues and error messages

Posted by lahirus <gi...@git.apache.org>.
Github user lahirus commented on a diff in the pull request:

    https://github.com/apache/stratos/pull/405#discussion_r35650531
  
    --- Diff: components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java ---
    @@ -3127,22 +3128,14 @@ public static void updateExistingTenant(org.apache.stratos.common.beans.TenantIn
     
             // filling the first and last name values
             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 RestAPIException(msg, e);
    -            }
    +            String msg = "Invalid first name is provided.";
    +            log.error(msg);
    +            throw new RestAPIException(msg);
    --- End diff --
    
    It is not the practice to throw RestAPIException for specific errors. There are some other places we haven't fixed yet(not added from this PR), that we need to fix.


---
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.
---

[GitHub] stratos pull request: Fixing formatting issues and error messages

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/stratos/pull/405


---
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.
---

[GitHub] stratos pull request: Fixing formatting issues and error messages

Posted by lahirus <gi...@git.apache.org>.
Github user lahirus commented on a diff in the pull request:

    https://github.com/apache/stratos/pull/405#discussion_r35650668
  
    --- Diff: components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java ---
    @@ -3127,22 +3128,14 @@ public static void updateExistingTenant(org.apache.stratos.common.beans.TenantIn
     
             // filling the first and last name values
             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 RestAPIException(msg, e);
    -            }
    +            String msg = "Invalid first name is provided.";
    +            log.error(msg);
    +            throw new RestAPIException(msg);
             }
             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 RestAPIException(msg, e);
    -            }
    +            String msg = "Invalid last name is provided.";
    +            log.error(msg);
    +            throw new RestAPIException(msg);
    --- End diff --
    
    Same issue of throwing RestAPIException for specific errors


---
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.
---