From 1f5a54f44895bdad7779793323867c581d54edcf Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sat, 6 Apr 2024 11:47:42 +0200 Subject: [PATCH] Improve an error message Knowing what erroneous value was passed will make debugging easier. --- src/pyfaf/checker.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pyfaf/checker.py b/src/pyfaf/checker.py index 373389a2..fff45e35 100644 --- a/src/pyfaf/checker.py +++ b/src/pyfaf/checker.py @@ -67,8 +67,8 @@ def check(self, obj) -> None: type(obj).__name__)) if self.allowed and obj not in self.allowed: - raise CheckError("Only the following values are allowed: {0}" - .format(", ".join(self.allowed))) + raise CheckError("Got {0}, but only the following values are allowed: {1}" + .format(obj, ", ".join(self.allowed))) class IntChecker(Checker):