Skip to content

Commit

Permalink
Print error when API provides an error.
Browse files Browse the repository at this point in the history
  • Loading branch information
YumYummity authored Feb 2, 2025
1 parent 3152d65 commit a43b6d6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sssekai/abcache/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,13 @@ def request_packed(self, method: str, url: str, data: dict = None, **kwargs):
data = packb(data)
data = encrypt(data, SEKAI_APIMANAGER_KEYSETS[self.config.app_region])
resp = self.request(method=method, url=url, data=data, **kwargs)
resp.raise_for_status()
if 400 <= resp.status_code < 600:
try: # print the error message provided by the API.
self.response_to_dict(resp)
print(resp)
except:
print(resp)
resp.raise_for_status()
return resp

def response_to_dict(self, resp: Response, **kwargs):
Expand Down

0 comments on commit a43b6d6

Please sign in to comment.