Skip to content

Commit ff29024

Browse files
authored
fix: fix APIError (#97)
1 parent 8cf3de1 commit ff29024

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

postgrest_py/exceptions.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ class APIError(Exception):
1414

1515
def __init__(self, error: Dict[str, str]) -> None:
1616
self._raw_error = error
17-
self.message = error["message"]
18-
self.code = error["code"]
19-
self.hint = error["hint"]
20-
self.details = error["details"]
17+
self.message = error.get("message")
18+
self.code = error.get("code")
19+
self.hint = error.get("hint")
20+
self.details = error.get("details")
2121
Exception.__init__(self, str(self))
2222

2323
def __repr__(self) -> str:

0 commit comments

Comments
 (0)