{"action":"created","comment":{"url":"https://api.github.com/repos/apache/stratos/pulls/comments/29998276","id":29998276,"diff_hunk":"@@ -2836,52 +2838,58 @@ public static void updateExistingTenant(org.apache.stratos.common.beans.TenantIn\n         } catch (UserStoreException e) {\n             String msg = \"Error in retrieving the tenant id for the tenant domain: \" + tenantDomain + \".\";\n             log.error(msg, e);\n-            throw new Exception(msg, e);\n+            throw new RestAPIException(msg, e);\n         }\n \n         Tenant tenant;\n         try {\n             tenant = (Tenant) tenantManager.getTenant(tenantId);\n         } catch (UserStoreException e) {\n-            String msg = \"Error in retrieving the tenant id for the tenant domain: \" +\n-                    tenantDomain + \".\";\n+            String msg = \"Error in retrieving the tenant from tenant id: \" +\n+                    tenantId + \".\";\n             log.error(msg, e);\n-            throw new TenantNotFoundException(msg, e);\n+            throw new RestAPIException(msg, e);\n         }\n \n         // filling the first and last name values\n-        if (tenantInfoBean.getFirstname() != null && !tenantInfoBean.getFirstname().trim().equals(\"\")) {\n+        if (StringUtils.isBlank(tenantInfoBean.getFirstname())) {\n             try {\n                 CommonUtil.validateName(tenantInfoBean.getFirstname(), \"First Name\");\n             } catch (Exception e) {\n                 String msg = \"Invalid first name is provided.\";\n                 log.error(msg, e);\n-                throw new Exception(msg, e);\n+                throw new RestAPIException(msg, e);\n             }\n         }\n-        if (tenantInfoBean.getLastname() != null && !tenantInfoBean.getLastname().trim().equals(\"\")) {\n+        if (StringUtils.isBlank(tenantInfoBean.getLastname())) {\n             try {\n                 CommonUtil.validateName(tenantInfoBean.getLastname(), \"Last Name\");\n             } catch (Exception e) {\n                 String msg = \"Invalid last name is provided.\";\n                 log.error(msg, e);\n-                throw new Exception(msg, e);\n+                throw new RestAPIException(msg, e);","path":"components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java","position":100,"original_position":100,"commit_id":"881329fcb5d0f1d11c08923430020fac333aab9b","original_commit_id":"881329fcb5d0f1d11c08923430020fac333aab9b","user":{"login":"lahirus","id":3665108,"avatar_url":"https://avatars.githubusercontent.com/u/3665108?v=3","gravatar_id":"","url":"https://api.github.com/users/lahirus","html_url":"https://github.com/lahirus","followers_url":"https://api.github.com/users/lahirus/followers","following_url":"https://api.github.com/users/lahirus/following{/other_user}","gists_url":"https://api.github.com/users/lahirus/gists{/gist_id}","starred_url":"https://api.github.com/users/lahirus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lahirus/subscriptions","organizations_url":"https://api.github.com/users/lahirus/orgs","repos_url":"https://api.github.com/users/lahirus/repos","events_url":"https://api.github.com/users/lahirus/events{/privacy}","received_events_url":"https://api.github.com/users/lahirus/received_events","type":"User","site_admin":false},"body":"Thold be handled with a specific exception, not with RestAPIException","created_at":"2015-05-10T02:56:51Z","updated_at":"2015-05-10T02:56:51Z","html_url":"https://github.com/apache/stratos/pull/298#discussion_r29998276","pull_request_url":"https://api.github.com/repos/apache/stratos/pulls/298","_links":{"self":{"href":"https://api.github.com/repos/apache/stratos/pulls/comments/29998276"},"html":{"href":"https://github.com/apache/stratos/pull/298#discussion_r29998276"},"pull_request":{"href":"https://api.github.com/repos/apache/stratos/pulls/298"}}},"pull_request":{"url":"https://api.github.com/repos/apache/stratos/pulls/298","id":34812885,"html_url":"https://github.com/apache/stratos/pull/298","diff_url":"https://github.com/apache/stratos/pull/298.diff","patch_url":"https://github.com/apache/stratos/pull/298.patch","issue_url":"https://api.github.com/repos/apache/stratos/issues/298","number":298,"state":"closed","locked":false,"title":"Moving non api methods","user":{"login":"anuruddhal","id":11031042,"avatar_url":"https://avatars.githubusercontent.com/u/11031042?v=3","gravatar_id":"","url":"https://api.github.com/users/anuruddhal","html_url":"https://github.com/anuruddhal","followers_url":"https://api.github.com/users/anuruddhal/followers","following_url":"https://api.github.com/users/anuruddhal/following{/other_user}","gists_url":"https://api.github.com/users/anuruddhal/gists{/gist_id}","starred_url":"https://api.github.com/users/anuruddhal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anuruddhal/subscriptions","organizations_url":"https://api.github.com/users/anuruddhal/orgs","repos_url":"https://api.github.com/users/anuruddhal/repos","events_url":"https://api.github.com/users/anuruddhal/events{/privacy}","received_events_url":"https://api.github.com/users/anuruddhal/received_events","type":"User","site_admin":false},"body":"Improvements to exception handling and string validation","created_at":"2015-05-06T12:47:39Z","updated_at":"2015-05-10T02:56:51Z","closed_at":"2015-05-09T17:18:05Z","merged_at":null,"merge_commit_sha":"e222e367afbde0d4b377a7aba536747804680d2f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/stratos/pulls/298/commits","review_comments_url":"https://api.github.com/repos/apache/stratos/pulls/298/comments","review_comment_url":"https://api.github.com/repos/apache/stratos/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/stratos/issues/298/comments","statuses_url":"https://api.github.com/repos/apache/stratos/statuses/881329fcb5d0f1d11c08923430020fac333aab9b","head":{"label":"anuruddhal:moving_non_API_methods","ref":"moving_non_API_methods","sha":"881329fcb5d0f1d11c08923430020fac333aab9b","user":{"login":"anuruddhal","id":11031042,"avatar_url":"https://avatars.githubusercontent.com/u/11031042?v=3","gravatar_id":"","url":"https://api.github.com/users/anuruddhal","html_url":"https://github.com/anuruddhal","followers_url":"https://api.github.com/users/anuruddhal/followers","following_url":"https://api.github.com/users/anuruddhal/following{/other_user}","gists_url":"https://api.github.com/users/anuruddhal/gists{/gist_id}","starred_url":"https://api.github.com/users/anuruddhal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anuruddhal/subscriptions","organizations_url":"https://api.github.com/users/anuruddhal/orgs","repos_url":"https://api.github.com/users/anuruddhal/repos","events_url":"https://api.github.com/users/anuruddhal/events{/privacy}","received_events_url":"https://api.github.com/users/anuruddhal/received_events","type":"User","site_admin":false},"repo":{"id":34835837,"name":"stratos","full_name":"anuruddhal/stratos","owner":{"login":"anuruddhal","id":11031042,"avatar_url":"https://avatars.githubusercontent.com/u/11031042?v=3","gravatar_id":"","url":"https://api.github.com/users/anuruddhal","html_url":"https://github.com/anuruddhal","followers_url":"https://api.github.com/users/anuruddhal/followers","following_url":"https://api.github.com/users/anuruddhal/following{/other_user}","gists_url":"https://api.github.com/users/anuruddhal/gists{/gist_id}","starred_url":"https://api.github.com/users/anuruddhal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anuruddhal/subscriptions","organizations_url":"https://api.github.com/users/anuruddhal/orgs","repos_url":"https://api.github.com/users/anuruddhal/repos","events_url":"https://api.github.com/users/anuruddhal/events{/privacy}","received_events_url":"https://api.github.com/users/anuruddhal/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/anuruddhal/stratos","description":"Mirror of Apache Stratos","fork":true,"url":"https://api.github.com/repos/anuruddhal/stratos","forks_url":"https://api.github.com/repos/anuruddhal/stratos/forks","keys_url":"https://api.github.com/repos/anuruddhal/stratos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/anuruddhal/stratos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/anuruddhal/stratos/teams","hooks_url":"https://api.github.com/repos/anuruddhal/stratos/hooks","issue_events_url":"https://api.github.com/repos/anuruddhal/stratos/issues/events{/number}","events_url":"https://api.github.com/repos/anuruddhal/stratos/events","assignees_url":"https://api.github.com/repos/anuruddhal/stratos/assignees{/user}","branches_url":"https://api.github.com/repos/anuruddhal/stratos/branches{/branch}","tags_url":"https://api.github.com/repos/anuruddhal/stratos/tags","blobs_url":"https://api.github.com/repos/anuruddhal/stratos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/anuruddhal/stratos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/anuruddhal/stratos/git/refs{/sha}","trees_url":"https://api.github.com/repos/anuruddhal/stratos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/anuruddhal/stratos/statuses/{sha}","languages_url":"https://api.github.com/repos/anuruddhal/stratos/languages","stargazers_url":"https://api.github.com/repos/anuruddhal/stratos/stargazers","contributors_url":"https://api.github.com/repos/anuruddhal/stratos/contributors","subscribers_url":"https://api.github.com/repos/anuruddhal/stratos/subscribers","subscription_url":"https://api.github.com/repos/anuruddhal/stratos/subscription","commits_url":"https://api.github.com/repos/anuruddhal/stratos/commits{/sha}","git_commits_url":"https://api.github.com/repos/anuruddhal/stratos/git/commits{/sha}","comments_url":"https://api.github.com/repos/anuruddhal/stratos/comments{/number}","issue_comment_url":"https://api.github.com/repos/anuruddhal/stratos/issues/comments{/number}","contents_url":"https://api.github.com/repos/anuruddhal/stratos/contents/{+path}","compare_url":"https://api.github.com/repos/anuruddhal/stratos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/anuruddhal/stratos/merges","archive_url":"https://api.github.com/repos/anuruddhal/stratos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/anuruddhal/stratos/downloads","issues_url":"https://api.github.com/repos/anuruddhal/stratos/issues{/number}","pulls_url":"https://api.github.com/repos/anuruddhal/stratos/pulls{/number}","milestones_url":"https://api.github.com/repos/anuruddhal/stratos/milestones{/number}","notifications_url":"https://api.github.com/repos/anuruddhal/stratos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/anuruddhal/stratos/labels{/name}","releases_url":"https://api.github.com/repos/anuruddhal/stratos/releases{/id}","created_at":"2015-04-30T05:22:46Z","updated_at":"2015-05-06T12:56:22Z","pushed_at":"2015-05-07T04:29:07Z","git_url":"git://github.com/anuruddhal/stratos.git","ssh_url":"git@github.com:anuruddhal/stratos.git","clone_url":"https://github.com/anuruddhal/stratos.git","svn_url":"https://github.com/anuruddhal/stratos","homepage":null,"size":55734,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"1ef37dbb2a23583ec406e5fa928af7fabb979b8d","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":20432793,"name":"stratos","full_name":"apache/stratos","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/stratos","description":"Mirror of Apache Stratos","fork":false,"url":"https://api.github.com/repos/apache/stratos","forks_url":"https://api.github.com/repos/apache/stratos/forks","keys_url":"https://api.github.com/repos/apache/stratos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/stratos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/stratos/teams","hooks_url":"https://api.github.com/repos/apache/stratos/hooks","issue_events_url":"https://api.github.com/repos/apache/stratos/issues/events{/number}","events_url":"https://api.github.com/repos/apache/stratos/events","assignees_url":"https://api.github.com/repos/apache/stratos/assignees{/user}","branches_url":"https://api.github.com/repos/apache/stratos/branches{/branch}","tags_url":"https://api.github.com/repos/apache/stratos/tags","blobs_url":"https://api.github.com/repos/apache/stratos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/stratos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/stratos/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/stratos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/stratos/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/stratos/languages","stargazers_url":"https://api.github.com/repos/apache/stratos/stargazers","contributors_url":"https://api.github.com/repos/apache/stratos/contributors","subscribers_url":"https://api.github.com/repos/apache/stratos/subscribers","subscription_url":"https://api.github.com/repos/apache/stratos/subscription","commits_url":"https://api.github.com/repos/apache/stratos/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/stratos/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/stratos/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/stratos/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/stratos/contents/{+path}","compare_url":"https://api.github.com/repos/apache/stratos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/stratos/merges","archive_url":"https://api.github.com/repos/apache/stratos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/stratos/downloads","issues_url":"https://api.github.com/repos/apache/stratos/issues{/number}","pulls_url":"https://api.github.com/repos/apache/stratos/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/stratos/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/stratos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/stratos/labels{/name}","releases_url":"https://api.github.com/repos/apache/stratos/releases{/id}","created_at":"2014-06-03T07:00:07Z","updated_at":"2015-05-08T13:54:15Z","pushed_at":"2015-05-09T17:18:04Z","git_url":"git://github.com/apache/stratos.git","ssh_url":"git@github.com:apache/stratos.git","clone_url":"https://github.com/apache/stratos.git","svn_url":"https://github.com/apache/stratos","homepage":null,"size":100016,"stargazers_count":72,"watchers_count":72,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":69,"mirror_url":"git://git.apache.org/stratos.git","open_issues_count":1,"forks":69,"open_issues":1,"watchers":72,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/stratos/pulls/298"},"html":{"href":"https://github.com/apache/stratos/pull/298"},"issue":{"href":"https://api.github.com/repos/apache/stratos/issues/298"},"comments":{"href":"https://api.github.com/repos/apache/stratos/issues/298/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/stratos/pulls/298/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/stratos/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/stratos/pulls/298/commits"},"statuses":{"href":"https://api.github.com/repos/apache/stratos/statuses/881329fcb5d0f1d11c08923430020fac333aab9b"}}}}