From e9c57049ddcb08fc3943f817e2aeef27757aff7f Mon Sep 17 00:00:00 2001 From: "Maxime Alves LIRMM@home" Date: Tue, 6 Sep 2022 21:51:48 +0200 Subject: [PATCH] [lib/domain] log.error unhandled exceptions --- CHANGELOG.md | 1 + halfapi/__init__.py | 2 +- halfapi/lib/domain.py | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b9a788e..9d7eb41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - IMPORTANT : Fix bug introduced with 0.6.20 (fix arguments handling) - Add *html* return type as default argument ret_type - Add *txt* return type +- Log unhandled exceptions - Log HTTPException with statuscode 500 as critical - PyJWT >=2.4.0,<2.5.0 diff --git a/halfapi/__init__.py b/halfapi/__init__.py index 4a9238c..3091438 100644 --- a/halfapi/__init__.py +++ b/halfapi/__init__.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -__version__ = '0.6.22-rc4' +__version__ = '0.6.22-rc5' def version(): return f'HalfAPI version:{__version__}' diff --git a/halfapi/lib/domain.py b/halfapi/lib/domain.py index 1c61d1a..17787f2 100644 --- a/halfapi/lib/domain.py +++ b/halfapi/lib/domain.py @@ -135,6 +135,7 @@ def route_decorator(fct: FunctionType) -> Coroutine: raise HTTPException(501) from exc except Exception as exc: # TODO: Write tests + logger.error(exc, exc_info=True) if not isinstance(exc, HTTPException): raise HTTPException(500) from exc raise exc