From dc0c4564af52a03c8b0724e6490d4d0f3564a377 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Fri, 16 Dec 2022 12:27:26 +0200 Subject: [PATCH] fix: merge conflict --- lnbits/app.py | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/lnbits/app.py b/lnbits/app.py index 009f884d..1b1292ce 100644 --- a/lnbits/app.py +++ b/lnbits/app.py @@ -281,28 +281,6 @@ def register_exception_handlers(app: FastAPI): content={"detail": exc.detail}, ) - @app.exception_handler(RequestValidationError) - async def validation_exception_handler( - request: Request, exc: RequestValidationError - ): - # Only the browser sends "text/html" request - # not fail proof, but everything else get's a JSON response - - if ( - request.headers - and "accept" in 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."}, - ) - - return JSONResponse( - status_code=HTTPStatus.NO_CONTENT, - content={"detail": exc.errors()}, - ) - def configure_logger() -> None: logger.remove()