Daniel Erez has uploaded a new change for review.

Change subject: core: catch OpenStackResponseException on execute
......................................................................

core: catch OpenStackResponseException on execute

CommandBase -> executeWithoutTransaction:
catch OpenStackResponseException to handle only when necessary
(i.e. when no failure messages have been added).

Change-Id: Ic84ee67e0cb83763d26bba82dd03131d5b97a38d
Bug-Url: https://bugzilla.redhat.com/1185826
Signed-off-by: Daniel Erez <de...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/26/38926/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
index 4e24779..4fb9a6b 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
@@ -17,6 +17,7 @@
 import javax.transaction.SystemException;
 import javax.transaction.Transaction;
 
+import com.woorea.openstack.base.client.OpenStackResponseException;
 import org.apache.commons.lang.StringUtils;
 import org.ovirt.engine.core.bll.aaa.SessionDataContainer;
 import org.ovirt.engine.core.bll.context.CommandContext;
@@ -1183,6 +1184,12 @@
                     e.getMessage());
             log.debug("Exception", e);
             processExceptionToClient(new VdcFault(e, 
e.getVdsError().getCode()));
+        } catch (OpenStackResponseException e) {
+            if (_returnValue.getExecuteFailedMessages().isEmpty()) {
+                processExceptionToClient(new VdcFault(e, VdcBllErrors.ENGINE));
+            }
+            log.error("Command '{}' failed: {}", getClass().getName(), 
e.getMessage());
+            log.error("Exception", e);
         } catch (RuntimeException e) {
             processExceptionToClient(new VdcFault(e, VdcBllErrors.ENGINE));
             log.error("Command '{}' failed: {}", getClass().getName(), 
e.getMessage());


-- 
To view, visit https://gerrit.ovirt.org/38926
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic84ee67e0cb83763d26bba82dd03131d5b97a38d
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Daniel Erez <de...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to