From 4913097265547dd2b1c3fbf32f097e461c623685 Mon Sep 17 00:00:00 2001 From: Simon Kelly Date: Fri, 7 Jun 2024 12:25:54 +0200 Subject: [PATCH] downgrade exception logs to warnings --- pyproject.toml | 4 ++-- taskbadger/celery.py | 4 ++-- taskbadger/decorators.py | 4 ++-- taskbadger/safe_sdk.py | 8 ++++---- taskbadger/sdk.py | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 09a87db..af9bc6b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "taskbadger" -version = "1.3.2" +version = "1.3.3" description = "The official Python SDK for Task Badger" license = "Apache-2.0" @@ -10,7 +10,7 @@ readme = "README.md" packages = [ {include = "taskbadger"}, ] -include = ["CHANGELOG.md", "taskbadger/internal/py.typed"] +include = ["taskbadger/internal/py.typed"] homepage = "https://taskbadger.net/" repository = "https://github.com/taskbadger/taskbadger-python" diff --git a/taskbadger/celery.py b/taskbadger/celery.py index 519c742..3705121 100644 --- a/taskbadger/celery.py +++ b/taskbadger/celery.py @@ -260,8 +260,8 @@ def exit_session(signal_sender): def safe_get_task(task_id: str): try: return get_task(task_id) - except Exception: - log.exception("Error fetching task '%s'", task_id) + except Exception as e: + log.warning("Error fetching task '%s': %s", task_id, e) def _get_taskbadger_task_id(request): diff --git a/taskbadger/decorators.py b/taskbadger/decorators.py index e0a4580..a310876 100644 --- a/taskbadger/decorators.py +++ b/taskbadger/decorators.py @@ -63,5 +63,5 @@ def _update_task(task, **kwargs): def _update_safe(task, **kwargs): try: task.update(**kwargs) - except Exception: - log.exception("Error updating task '%s'", task.id) + except Exception as e: + log.warning("Error updating task '%s': %s", task.id, e) diff --git a/taskbadger/safe_sdk.py b/taskbadger/safe_sdk.py index 479b1c0..a6fa061 100644 --- a/taskbadger/safe_sdk.py +++ b/taskbadger/safe_sdk.py @@ -29,8 +29,8 @@ def create_task_safe(name: str, **kwargs: P.kwargs) -> Optional[Task]: try: return create_task(name, **kwargs) - except Exception: - log.exception("Error creating task '%s'", name) + except Exception as e: + log.warning("Error creating task '%s': %s", name, e) def update_task_safe(task_id: str, **kwargs: P.kwargs) -> Optional[Task]: @@ -48,5 +48,5 @@ def update_task_safe(task_id: str, **kwargs: P.kwargs) -> Optional[Task]: try: return update_task(task_id, **kwargs) - except Exception: - log.exception("Error updating task '%s'", task_id) + except Exception as e: + log.warning("Error updating task '%s': %s", task_id, e) diff --git a/taskbadger/sdk.py b/taskbadger/sdk.py index 3e01d97..bcfcdb6 100644 --- a/taskbadger/sdk.py +++ b/taskbadger/sdk.py @@ -345,7 +345,7 @@ def safe_update(self, **kwargs): try: self.update(**kwargs) except Exception as e: - log.exception("Error updating task '%s'", self._task.id) + log.warning("Error updating task '%s': %s", self._task.id, e) def _none_to_unset(value):