mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-02-24 06:48:02 +01:00
parent
0f760bf39e
commit
9bc99f796b
1 changed files with 2 additions and 2 deletions
|
@ -76,7 +76,7 @@ def create_app(config_object="lnbits.settings") -> FastAPI:
|
|||
# Only the browser sends "text/html" request
|
||||
# not fail proof, but everything else get's a JSON response
|
||||
|
||||
if "text/html" in request.headers.get("accept"):
|
||||
if request.headers and "text/html" in request.headers["accept"]:
|
||||
return template_renderer().TemplateResponse(
|
||||
"error.html",
|
||||
{"request": request, "err": f"{exc.errors()} is not a valid UUID."},
|
||||
|
@ -197,7 +197,7 @@ def register_exception_handlers(app: FastAPI):
|
|||
traceback.print_exception(etype, err, tb)
|
||||
exc = traceback.format_exc()
|
||||
|
||||
if "text/html" in request.headers.get("accept"):
|
||||
if request.headers and "text/html" in request.headers["accept"]:
|
||||
return template_renderer().TemplateResponse(
|
||||
"error.html", {"request": request, "err": err}
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue