Skip to content

Commit

Permalink
downgrade exception logs to warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
snopoke committed Jun 7, 2024
1 parent 0ebf3e6 commit 4913097
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"

Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions taskbadger/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions taskbadger/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
8 changes: 4 additions & 4 deletions taskbadger/safe_sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand All @@ -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)
2 changes: 1 addition & 1 deletion taskbadger/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 4913097

Please sign in to comment.