diff options
author | Maros Marsalek <mmarsale@cisco.com> | 2016-04-12 10:13:02 +0200 |
---|---|---|
committer | Maros Marsalek <mmarsale@cisco.com> | 2016-04-12 10:13:02 +0200 |
commit | 5947a575539402344e450fd34b03f555b84523be (patch) | |
tree | 595ab3fc05ecc28d08b4b1d625e4e20980a33b6b /v3po/impl/src/main/java/io/fd/honeycomb/v3po/impl/data/VppConfigDataTree.java | |
parent | 9ac68bac54d95b0342cab52bf39a4321f1f42d79 (diff) |
HONEYCOMB-9: Exception handling for VPP APIs
Change-Id: Ic71a2ac3d01e88cb38596a24a12a7bf8ebf54da5
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Diffstat (limited to 'v3po/impl/src/main/java/io/fd/honeycomb/v3po/impl/data/VppConfigDataTree.java')
-rw-r--r-- | v3po/impl/src/main/java/io/fd/honeycomb/v3po/impl/data/VppConfigDataTree.java | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/v3po/impl/src/main/java/io/fd/honeycomb/v3po/impl/data/VppConfigDataTree.java b/v3po/impl/src/main/java/io/fd/honeycomb/v3po/impl/data/VppConfigDataTree.java index f14bec3aa..9f34fcbd1 100644 --- a/v3po/impl/src/main/java/io/fd/honeycomb/v3po/impl/data/VppConfigDataTree.java +++ b/v3po/impl/src/main/java/io/fd/honeycomb/v3po/impl/data/VppConfigDataTree.java @@ -118,15 +118,13 @@ public final class VppConfigDataTree implements VppDataTree { try { e.revertChanges(); LOG.info("Changes successfully reverted"); - } catch (VppException | RuntimeException e2) { - LOG.error("Failed to revert successful changes", e2); + } catch (WriterRegistry.Reverter.RevertFailedException revertFailedException) { + // fail with failed revert + LOG.error("Failed to revert successful changes", revertFailedException); + throw revertFailedException; } - // rethrow as we can't do anything more about it - // FIXME we need to throw a different kind of exception here to differentiate between: - // fail with success revert - // fail with failed revert (this one needs to contain IDs of changes that were not reverted) - throw e; + throw e; // fail with success revert } catch (VppException e) { LOG.error("Error while processing data change (before={}, after={})", nodesBefore, nodesAfter, e); throw e; |