From 3ae2c87f9c8da3fb7022d2f269aab7f761a7779c Mon Sep 17 00:00:00 2001
From: Eric Torrence <eric.torrence@cern.ch>
Date: Mon, 13 Sep 2021 00:49:16 +0200
Subject: [PATCH] Catch raw data format errors

---
 Event/FaserByteStreamCnvSvc/src/FaserByteStreamInputSvc.cxx | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Event/FaserByteStreamCnvSvc/src/FaserByteStreamInputSvc.cxx b/Event/FaserByteStreamCnvSvc/src/FaserByteStreamInputSvc.cxx
index d24a2f65b..e2bb49c32 100644
--- a/Event/FaserByteStreamCnvSvc/src/FaserByteStreamInputSvc.cxx
+++ b/Event/FaserByteStreamCnvSvc/src/FaserByteStreamInputSvc.cxx
@@ -128,6 +128,11 @@ const EventFull* FaserByteStreamInputSvc::nextEvent() {
 	// Attempt to read beyond end of file, likely truncated event
 	ATH_MSG_WARNING("DataReader reports FaserEventStorage::ES_OutOfFileBoundary, stop reading file!");
 	return NULL;
+      } catch (const DAQFormats::EFormatException& e) {
+	// Format error
+	ATH_MSG_WARNING("DataReader reports DAQFormats::EFormatException, stop reading file!");
+	ATH_MSG_WARNING(e.what());
+	return NULL;
       } catch (...) {
 	// rethrow any other exceptions
 	throw;
-- 
GitLab