mirror of https://github.com/apache/cloudstack.git
bug 10276: Throw exception for account APIs failure
status 10276: resolved fixed
This commit is contained in:
parent
186654b299
commit
8069a45a26
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1636,7 +1636,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
|
||||
|
|
|
|||
Loading…
Reference in New Issue