This exception is needed for the non exist tenant domain. As we discussed
offline, i will change this particular exception to InvalidDomainException
and send the pull request again.

On Mon, May 18, 2015 at 2:36 PM, lahirus <g...@git.apache.org> wrote:

> Github user lahirus commented on a diff in the pull request:
>
>     https://github.com/apache/stratos/pull/329#discussion_r30491310
>
>     --- Diff:
> components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
> ---
>     @@ -3170,7 +3170,27 @@ public static void deactivateTenant(String
> tenantDomain) throws RestAPIException
>              int tenantId;
>              try {
>                  tenantId = tenantManager.getTenantId(tenantDomain);
>     +            if (tenantId != -1) {
>     +                try {
>     +                    TenantMgtUtil.deactivateTenant(tenantDomain,
> tenantManager, tenantId);
>     +                } catch (Exception e) {
>     +                    String msg = "Error in deactivating Tenant :" +
> tenantDomain;
>     +                    log.error(msg, e);
>     +                    throw new RestAPIException(msg, e);
>     +                }
>
>     +                //Notify tenant deactivation all listeners
>     +                try {
>     +                    TenantMgtUtil.triggerTenantDeactivation(tenantId);
>     +                } catch (StratosException e) {
>     +                    String msg = "Error in notifying tenant
> deactivate.";
>     +                    log.error(msg, e);
>     +                    throw new RestAPIException(msg, e);
>     +                }
>     +            } else {
>     +                String msg = "The tenant with domain name: " +
> tenantDomain + " does not exist.";
>     +                throw new RestAPIException(msg);
>     --- End diff --
>
>     Is this a specific exception? Or an internal issue?
>     If it is not an internal issue, we should not throw 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 infrastruct...@apache.org or file a JIRA ticket
> with INFRA.
> ---
>



-- 

*Pubudu Gunatilaka*
Software Engineer
WSO2, Inc.: http://wso2.com
lean.enterprise.middleware
mobile:  +94 77 4078049

Reply via email to