Fix exception causes all over the codebase (#1014)

This commit is contained in:
Ram Rachum 2023-12-25 22:15:38 +02:00 committed by GitHub
parent cb6512dd5a
commit 70cc1f439d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -397,8 +397,8 @@ class WolframAlphaAPIWrapper(BaseModel):
try:
import wolframalpha
except ImportError:
raise ImportError("wolframalpha is not installed. " "Please install it with `pip install wolframalpha`")
except ImportError as e:
raise ImportError("wolframalpha is not installed. Please install it with `pip install wolframalpha`") from e
client = wolframalpha.Client(wolfram_alpha_appid)
values["wolfram_client"] = client

View File

@ -128,7 +128,7 @@ def serialize_file(file_path: str) -> Tuple[str, str]:
file_content = file.read()
base64_encoded_content = base64.b64encode(file_content).decode("utf-8")
except Exception as e:
raise IOError(f"An error occurred while reading the file: {e}")
raise IOError(f"An error occurred while reading the file: {e}") from e
return base64_encoded_content, file_type