mirror of
https://github.com/microsoft/autogen.git
synced 2026-01-06 04:01:12 +00:00
Fix exception causes all over the codebase (#1014)
This commit is contained in:
parent
cb6512dd5a
commit
70cc1f439d
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user