Better errors when the server fails

This commit is contained in:
cmdr2 2022-09-22 18:04:11 +05:30
parent 310abcd8b9
commit f98225cdb6

View File

@ -189,8 +189,14 @@ def mk_img(req: Request):
try:
yield from do_mk_img(req)
except Exception as e:
print(traceback.format_exc())
gc()
raise e
yield json.dumps({
"status": 'failed',
"detail": str(e)
})
def do_mk_img(req: Request):
global model, modelCS, modelFS, device