From c1fd95197f17c5ecf867a91c3851003db0f36f17 Mon Sep 17 00:00:00 2001
From: Daniel Bauer <daniel.j.bauer@fau.de>
Date: Thu, 28 Mar 2024 11:07:57 +0100
Subject: [PATCH] improve error messages

---
 src/pystencils/backend/symbols.py   | 4 +++-
 src/pystencils/types/basic_types.py | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/pystencils/backend/symbols.py b/src/pystencils/backend/symbols.py
index 9b0d81546..065a3c8dc 100644
--- a/src/pystencils/backend/symbols.py
+++ b/src/pystencils/backend/symbols.py
@@ -42,7 +42,9 @@ class PsSymbol:
 
     def get_dtype(self) -> PsType:
         if self._dtype is None:
-            raise PsInternalCompilerError("Symbol had no type assigned yet")
+            raise PsInternalCompilerError(
+                f"Symbol {self.name} had no type assigned yet"
+            )
         return self._dtype
 
     def __eq__(self, other: object) -> bool:
diff --git a/src/pystencils/types/basic_types.py b/src/pystencils/types/basic_types.py
index 7565ea9a5..b83b6d7d6 100644
--- a/src/pystencils/types/basic_types.py
+++ b/src/pystencils/types/basic_types.py
@@ -655,7 +655,7 @@ class PsIeeeFloatType(PsScalarType):
     def __init__(self, width: int, const: bool = False):
         if width not in self.SUPPORTED_WIDTHS:
             raise ValueError(
-                f"Invalid integer width; must be one of {self.SUPPORTED_WIDTHS}."
+                f"Invalid integer width {width}; must be one of {self.SUPPORTED_WIDTHS}."
             )
 
         super().__init__(const)
-- 
GitLab