- public void close() {
- RuntimeException firstException = null;
- for (NetconfOperationService service : services) {
- try {
- service.close();
- } catch (RuntimeException e) {
- logger.warn("Got exception while closing {}", service, e);
- if (firstException == null) {
- firstException = e;
- } else {
- firstException.addSuppressed(e);
- }
- }
- }
- if (firstException != null) {
- throw firstException;
- }