Skip to content

Commit

Permalink
Improved error handling (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
ddl-joyce-zhao authored Jul 26, 2023
1 parent 26cb1c8 commit d8157e6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion domino_data/data_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,12 @@ def get_datasource(self, name: str) -> Datasource:
)
return datasource_klass.from_dto(self, datasource_dto)

message = cast(ErrorResponse, response.parsed).message
error_response = cast(ErrorResponse, response.parsed)
message = (
f"Received unexpected response {response.status_code} while getting data source"
if error_response is None
else error_response.message
)
logger.exception(message)
raise Exception(message)

Expand Down

0 comments on commit d8157e6

Please sign in to comment.