[lib/domain] log.error unhandled exceptions

This commit is contained in:
Maxime Alves LIRMM@home 2022-09-06 21:51:48 +02:00
parent e47ffcddb9
commit e9c57049dd
3 changed files with 3 additions and 1 deletions

View File

@ -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

View File

@ -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__}'

View File

@ -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