Skip to content

Commit

Permalink
Cleaning up debug code that was left behind and optimizing try/catch
Browse files Browse the repository at this point in the history
  • Loading branch information
krachwal committed Dec 19, 2023
1 parent dab29d2 commit 145c08c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions python-backend/wolfram_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,10 @@ def ask(query: str, include_pod: str = None) -> str:
try:
result = json.loads(result.content)
try:
result["queryresult"]["error"]["code"]
raise APIError(result["queryresult"]["error"]["msg"])
except (AttributeError, TypeError):
# if the key does not exist or is false then the api call was successful
pass
else:
raise APIError(result["queryresult"]["error"]["msg"])
print("TYPE = {}", type(result))
return result
except JSONDecodeError as e:
logger.error("Failed to parse Wolfram API result", e)
Expand Down

0 comments on commit 145c08c

Please sign in to comment.