From 4e027c7784f93a3f730f24097f7af721744a9657 Mon Sep 17 00:00:00 2001 From: dnutiu Date: Sun, 21 Jan 2024 23:04:35 +0200 Subject: [PATCH] improve parser exceptions --- src/dice/parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dice/parser.py b/src/dice/parser.py index 8051038..a2f3fca 100644 --- a/src/dice/parser.py +++ b/src/dice/parser.py @@ -41,6 +41,6 @@ class DieParser: logging.debug(f"rolling die for {expression} -> result={result}") return result except tatsu.exceptions.FailedParse as e: - message = f"Failed to roll {expression}: {e.message}" + message = f"Failed to roll {expression}: {str(e)}" self._logger.error(message) raise ValueError(message) from e