diff --git a/iwm_browser/main.py b/iwm_browser/main.py index 3e06141..01ab96a 100644 --- a/iwm_browser/main.py +++ b/iwm_browser/main.py @@ -153,7 +153,7 @@ async def showUser(user_id: int): try: rq = httpx.get(BASE_URL + "/api/v1/user/" + str(user_id), timeout=10) - if status_code == 503: + if rq.status_code == 503: return error_template.render(reason="Server is unavailable right now") searchResults = rq.json() print(rq.url) @@ -162,6 +162,7 @@ async def showUser(user_id: int): except json.decoder.JSONDecodeError: return error_template.render(reason="Failed to parse server response.", details=rq.text) except Exception as exc: + print(exc) return error_template.render(reason="Uncaught exception", details=exc)