bug 10276: Throw exception for account APIs failure

status 10276: resolved fixed
This commit is contained in:
kishan 2011-07-11 14:09:13 +05:30
parent 24510cd5fb
commit 427b70e572
2 changed files with 13 additions and 3 deletions

View File

@ -31,11 +31,18 @@ public class ActionEventCallback implements MethodInterceptor, AnnotationInterce
@Override
public Object intercept(Object object, Method method, Object[] args, MethodProxy methodProxy) throws Throwable {
EventVO event = interceptStart(method);;
EventVO event = interceptStart(method);
boolean success = true;
try {
return methodProxy.invokeSuper(object, args);
} catch (Exception e){
success = false;
interceptException(method, event);
return null;
} finally {
interceptComplete(method, event);
if(success){
interceptComplete(method, event);
}
}
}

View File

@ -1612,7 +1612,10 @@ public class AccountManagerImpl implements AccountManager, AccountService, Manag
return true;
}
return deleteAccount(account, callerUserId, caller);
if(!deleteAccount(account, callerUserId, caller)){
throw new CloudRuntimeException("Unable to delete account " + account.getAccountName() + " in domain " + account.getDomainId());
}
return true;
}
@Override