Skip to content

Commit 5e112a5

Browse files
author
Andrei Neagu
committed
refactor
1 parent a773dbd commit 5e112a5

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

packages/service-library/src/servicelib/fastapi/long_running_tasks/_context_manager.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,18 +119,18 @@ async def _wait_for_task_result() -> Any:
119119
_logger.debug("%s, %s", f"{task_id=}", f"{result=}")
120120

121121
yield result
122-
except Exception as e:
123-
error = TaskExceptionError(
124-
task_id=task_id,
125-
exception=e,
126-
traceback=f"check remote side for logs, HINT: service replying to: '{client._base_url}' for '{task_id=}'",
127-
)
128-
_logger.warning(f"{error}")
129-
raise error from e
130122
except TimeoutError as e:
131123
await client.cancel_and_delete_task(task_id)
132124
raise TaskClientTimeoutError(
133125
task_id=task_id,
134126
timeout=task_timeout,
135127
exception=e,
136128
) from e
129+
except Exception as e:
130+
error = TaskExceptionError(
131+
task_id=task_id,
132+
exception=e,
133+
traceback=f"check remote side for logs, HINT: service replying to: '{client._base_url}' for '{task_id=}'", # noqa: SLF001 # pylint:disable=protected-access
134+
)
135+
_logger.warning(f"{error}")
136+
raise error from e

0 commit comments

Comments
 (0)