onitake commented on issue #3546: [FIX] Rethrow takeVMSnapshot() exception URL: https://github.com/apache/cloudstack/pull/3546#issuecomment-520497337 @DaanHoogland Setting the snapshot state to "Error" would involve something like this: ```java try { VMSnapshot.State.getStateMachine().transitTo(vmSnapshot, VMSnapshot.Event.OperationFailed, null, _vmSnapshotDao); } catch (NoTransitionException ex) { throw new CloudRuntimeException("Cannot transit snapshot to failed state", ex); } ``` I'm not sure putting this into the exception handler is a good idea. Maybe it would be better to ensure the CloudRuntimeException is accounted for. There should already be code for setting the error state somewhere.
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services