From da1ae20f3052ab16cbb70a4932111bac81eb8a65 Mon Sep 17 00:00:00 2001 From: Marco Cucchi Date: Tue, 28 Jan 2025 12:37:40 +0100 Subject: [PATCH] type annotation --- cads_processing_api_service/exceptions.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cads_processing_api_service/exceptions.py b/cads_processing_api_service/exceptions.py index e5fa88ac..e2110db9 100644 --- a/cads_processing_api_service/exceptions.py +++ b/cads_processing_api_service/exceptions.py @@ -16,6 +16,7 @@ import functools import traceback +from typing import Any, Callable import attrs import fastapi @@ -64,9 +65,9 @@ class RateLimitExceeded(ogc_api_processes_fastapi.exceptions.OGCAPIException): retry_after: int = 0 -def exception_logger(f): +def exception_logger(f: Callable[..., Any]) -> Callable[..., Any]: @functools.wraps(f) - def wrapper(*args, **kwargs): + def wrapper(*args: Any, **kwargs: Any) -> Any: try: res = f(*args, **kwargs) except requests.exceptions.ReadTimeout: