mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-02-22 14:22:55 +01:00
fix response
This commit is contained in:
parent
1ebba9f846
commit
3e8d2a5ba1
1 changed files with 3 additions and 2 deletions
|
@ -174,6 +174,7 @@ def register_exception_handlers(app: FastAPI):
|
|||
@app.exception_handler(Exception)
|
||||
async def basic_error(request: Request, err):
|
||||
print("handled error", traceback.format_exc())
|
||||
print("ERROR:", err)
|
||||
etype, _, tb = sys.exc_info()
|
||||
traceback.print_exception(etype, err, tb)
|
||||
exc = traceback.format_exc()
|
||||
|
@ -182,8 +183,8 @@ def register_exception_handlers(app: FastAPI):
|
|||
return template_renderer().TemplateResponse(
|
||||
"error.html", {"request": request, "err": err}
|
||||
)
|
||||
|
||||
|
||||
return JSONResponse(
|
||||
status_code=HTTPStatus.NO_CONTENT,
|
||||
content={"detail": exc},
|
||||
content={"detail": err},
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue