From 9863991e212ed114735b0764eb60e1fc63057b30 Mon Sep 17 00:00:00 2001
From: Simon Spinner <simon.spinner@uni-wuerzburg.de>
Date: Fri, 27 May 2016 11:14:29 +0200
Subject: [PATCH] Catch exceptions in OutputWriter.

---
 .../agent/wildfly/service/MonitoringService.java       | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/tools.descartes.prisma.agent.wildfly/src/main/java/tools/descartes/prisma/agent/wildfly/service/MonitoringService.java b/tools.descartes.prisma.agent.wildfly/src/main/java/tools/descartes/prisma/agent/wildfly/service/MonitoringService.java
index a970b5c..632d5f7 100644
--- a/tools.descartes.prisma.agent.wildfly/src/main/java/tools/descartes/prisma/agent/wildfly/service/MonitoringService.java
+++ b/tools.descartes.prisma.agent.wildfly/src/main/java/tools/descartes/prisma/agent/wildfly/service/MonitoringService.java
@@ -104,9 +104,13 @@ public class MonitoringService extends AgentController implements Service<Monito
 		}
 
 		public void run() {
-			long currentTime = System.currentTimeMillis();
-			collectMonitoringData(out, (currentTime / 1000.0));
-			out.flush();
+			try {
+				long currentTime = System.currentTimeMillis();
+				collectMonitoringData(out, (currentTime / 1000.0));
+				out.flush();
+			} catch (Throwable ex) {
+				log.error("Error collecting monitoring data.", ex);
+			}
 		};
 	};
 
-- 
GitLab