diff --git a/pytools/persistent_dict.py b/pytools/persistent_dict.py index 18057d56c76f704aea14869a8487ab300b12c14f..8420791909b616636aca3d8cd5adcc61171a669d 100644 --- a/pytools/persistent_dict.py +++ b/pytools/persistent_dict.py @@ -649,12 +649,12 @@ class WriteOncePersistentDict(_PersistentDictBase): try: read_key = self._read(key_file) - except Exception: + except Exception as e: self._warn("pytools.persistent_dict.WriteOncePersistentDict(%s) " "encountered an invalid " "key file for key %s. Remove the directory " - "'%s' if necessary." - % (self.identifier, hexdigest_key, item_dir)) + "'%s' if necessary. (caught: %s)" + % (self.identifier, hexdigest_key, item_dir, str(e))) raise NoSuchEntryError(key) self._collision_check(key, read_key)