This commit is contained in:
magmaus3 2022-10-30 17:18:37 +01:00
parent 25a57d7b0e
commit ee79588a55
Signed by: magmaus3
GPG key ID: 966755D3F4A9B251

View file

@ -153,7 +153,7 @@ async def showUser(user_id: int):
try: try:
rq = httpx.get(BASE_URL + "/api/v1/user/" + str(user_id), timeout=10) 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") return error_template.render(reason="Server is unavailable right now")
searchResults = rq.json() searchResults = rq.json()
print(rq.url) print(rq.url)
@ -162,6 +162,7 @@ async def showUser(user_id: int):
except json.decoder.JSONDecodeError: except json.decoder.JSONDecodeError:
return error_template.render(reason="Failed to parse server response.", details=rq.text) return error_template.render(reason="Failed to parse server response.", details=rq.text)
except Exception as exc: except Exception as exc:
print(exc)
return error_template.render(reason="Uncaught exception", details=exc) return error_template.render(reason="Uncaught exception", details=exc)