diff --git a/paperqa/types.py b/paperqa/types.py index 845a045f..071f8008 100644 --- a/paperqa/types.py +++ b/paperqa/types.py @@ -124,10 +124,10 @@ def ensure_doc(cls, values: Any) -> Any: try: doc = DocDetails(**copy_doc_data) values["doc"] = doc - except ValidationError as exc: + except ValidationError as e: raise ValidationError( f"Failed to deserialize doc data from {doc_data}." - ) from exc + ) from e return values