Skip to content

Commit

Permalink
add more clarity to server_message func
Browse files Browse the repository at this point in the history
  • Loading branch information
philkra committed Jan 3, 2024
1 parent 0592db9 commit 611d03c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions xata/api_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ def __init__(self, response: Response):

def server_message(self) -> Union[str, None]:
"""
Get the server message from the response
Get the server message from the response, if you need the error message
please the property error_message. This channel is only relevant for
deprecation messages or other meta information from Xata
:returns str | None
"""
return self.headers["x-xata-message"] if "x-xata-message" in self.headers else None
Expand Down Expand Up @@ -95,7 +97,7 @@ def status_code(self) -> int:
return self.response.status_code

@property
def error_message(self) -> str | None:
def error_message(self) -> Union[str, None]:
"""
Get the error message if it is set, otherwise None
:returns str | None
Expand Down

0 comments on commit 611d03c

Please sign in to comment.