diff --git a/hwt/serializer/hwt/__init__.py b/hwt/serializer/hwt/__init__.py
index <HASH>..<HASH> 100644
--- a/hwt/serializer/hwt/__init__.py
+++ b/hwt/serializer/hwt/__init__.py
@@ -5,6 +5,7 @@ from hdlConvertorAst.to.hwt._main import ToHwt
 from hwt.serializer.hwt.serializer import ToHdlAstHwt
 from hwt.serializer.serializer_config import DummySerializerConfig
 from hdlConvertorAst.hdlAst import iHdlObj
+from hwt.serializer.exceptions import SerializerException
 
 
 class HwtSerializer(DummySerializerConfig):
@@ -18,7 +19,7 @@ class ToHdlAstDebugHwt(ToHdlAstHwt):
     def as_hdl(self, obj) -> iHdlObj:
         try:
             return super(ToHdlAstDebugHwt, self).as_hdl(obj)
-        except:
+        except SerializerException:
             return obj.__repr__()
ToHdlAstDebugHwt.as_hdl: catch only specific exceptions

* to minimize the probability of inf. loop