From c930bf83c04550f8e1bd620400d4f51c8ab17f44 Mon Sep 17 00:00:00 2001
From: Martin Teichmann <martin.teichmann@xfel.eu>
Date: Thu, 29 Feb 2024 15:06:10 +0000
Subject: [PATCH] improve error messages

---
 ebpfcat/ethercat.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/ebpfcat/ethercat.py b/ebpfcat/ethercat.py
index b6e02a7..f9c1f43 100644
--- a/ebpfcat/ethercat.py
+++ b/ebpfcat/ethercat.py
@@ -819,10 +819,12 @@ class Terminal:
                         index, subindex, data)
                 type, data = await self.mbx_recv()
             if type is not MBXType.COE:
-                raise EtherCatError(f"expected CoE, got {type}, {data} {odata} {index:x} {subindex}")
+                raise EtherCatError(f"expected CoE, got {type}, {data} "
+                                    f"{odata} {index:x}:{subindex:x}")
             coecmd, sdocmd, idx, subidx = unpack("<HBHB", data[:6])
             if idx != index or subindex != subidx:
-                raise EtherCatError(f"requested index {index}, got {idx}")
+                raise EtherCatError(f"requested index {index:x}:{subindex:x}, "
+                                    f"got {idx:x}:{subidx:x}")
             if coecmd >> 12 != CoECmd.SDORES.value:
                 raise EtherCatError(f"expected CoE SDORES, got {coecmd>>12:x}")
         else:
-- 
GitLab