From ed40ac9c1e6614baa3e71ba7cd2d257542b1815c Mon Sep 17 00:00:00 2001 From: Christian Wulf <chw@informatik.uni-kiel.de> Date: Tue, 4 Nov 2014 05:57:26 +0100 Subject: [PATCH] fixed exception handling --- src/main/java/teetime/stage/io/network/TcpReader.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/teetime/stage/io/network/TcpReader.java b/src/main/java/teetime/stage/io/network/TcpReader.java index 83a97ece..891dee55 100644 --- a/src/main/java/teetime/stage/io/network/TcpReader.java +++ b/src/main/java/teetime/stage/io/network/TcpReader.java @@ -25,7 +25,7 @@ import java.nio.channels.SocketChannel; import teetime.stage.io.AbstractTcpReader; -import kieker.common.exception.MonitoringRecordException; +import kieker.common.exception.RecordInstantiationException; import kieker.common.logging.Log; import kieker.common.logging.LogFactory; import kieker.common.record.IMonitoringRecord; @@ -81,15 +81,14 @@ public class TcpReader extends AbstractTcpReader<IMonitoringRecord> { final String recordClassName = this.stringRegistry.get(clazzId); try { - // final IMonitoringRecord record = AbstractMonitoringRecord.createFromByteBuffer(clazzId, buffer, this.stringRegistry); - // record.setLoggingTimestamp(loggingTimestamp); - final IRecordFactory<? extends IMonitoringRecord> recordFactory = this.recordFactories.get(recordClassName); - record = recordFactory.create(buffer, this.stringRegistry); + IMonitoringRecord record = recordFactory.create(buffer, this.stringRegistry); record.setLoggingTimestamp(loggingTimestamp); this.send(this.outputPort, record); - } catch (final MonitoringRecordException ex) { + } catch (final BufferUnderflowException ex) { + super.logger.error("Failed to create record.", ex); + } catch (final RecordInstantiationException ex) { super.logger.error("Failed to create record.", ex); } } -- GitLab