mirror of
https://github.com/linuxserver/docker-lsio-api.git
synced 2026-01-09 07:10:49 +08:00
Merge pull request #6 from linuxserver/fix-errorcode
Fix error code on healthcheck failure
This commit is contained in:
commit
42b058ceaf
@ -26,7 +26,8 @@ async def get_status():
|
||||
async def health():
|
||||
try:
|
||||
content = await get_status()
|
||||
return JSONResponse(content=content)
|
||||
status_code = 200 if content == "Success" else 500
|
||||
return JSONResponse(content=content, status_code=status_code)
|
||||
except Exception:
|
||||
print(traceback.format_exc())
|
||||
raise HTTPException(status_code=404, detail="Not found")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user