commit | b9e491b553569be704c44dba2689846423629251 | [log] [tgz] |
---|---|---|
author | Andrea Campanella <andrea@opennetworking.org> | Mon Feb 18 17:45:01 2019 +0100 |
committer | Andrea Campanella <andrea@opennetworking.org> | Wed Mar 13 00:44:42 2019 +0000 |
tree | 0e1980e5404b1b07a51954b2943f5a3d02c19a38 | |
parent | 0e3b623f6681429985b0d2f3ac025ed32b89346e [diff] |
Fix for ADVA ols with TAPI Change-Id: I91d0002dc67697d394f6a97ed7f97089054f4837
diff --git a/providers/rest/device/src/main/java/org/onosproject/provider/rest/device/impl/RestDeviceProvider.java b/providers/rest/device/src/main/java/org/onosproject/provider/rest/device/impl/RestDeviceProvider.java index cd738cd..c89e59b 100644 --- a/providers/rest/device/src/main/java/org/onosproject/provider/rest/device/impl/RestDeviceProvider.java +++ b/providers/rest/device/src/main/java/org/onosproject/provider/rest/device/impl/RestDeviceProvider.java
@@ -581,6 +581,16 @@ return false; } + private Runnable exceptionSafe(Runnable runnable) { + return () -> { + try { + runnable.run(); + } catch (Exception e) { + log.error("Unhandled Exception", e); + } + }; + } + private class InternalNetworkConfigListener implements NetworkConfigListener { @Override public void event(NetworkConfigEvent event) { @@ -601,7 +611,7 @@ event.type(), event.config().get().subject()); RestDeviceConfig cfg = (RestDeviceConfig) event.config().get(); RestSBDevice restSBDevice = toInactiveRestSBDevice(cfg); - bg.execute(() -> connectDevice(restSBDevice)); + bg.execute(exceptionSafe(() -> connectDevice(restSBDevice))); } }