From 75c3797a381fd9c5fce5c553a84a432942a04f6f Mon Sep 17 00:00:00 2001 From: Hans Vanrompay Date: Wed, 8 Jan 2025 09:32:46 +0100 Subject: [PATCH] remove try, except --- openeo/extra/job_management/__init__.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/openeo/extra/job_management/__init__.py b/openeo/extra/job_management/__init__.py index 26cd66f27..41b8fdfd3 100644 --- a/openeo/extra/job_management/__init__.py +++ b/openeo/extra/job_management/__init__.py @@ -669,13 +669,12 @@ def _cancel_prolonged_job(self, job: BatchJob, row): elapsed = current_time - job_running_start_time if elapsed > self._cancel_running_job_after: - try: - _log.info( - f"Cancelling long-running job {job.job_id} (after {elapsed}, running since {job_running_start_time})" - ) - job.stop() - except OpenEoApiError as e: - _log.error(f"Failed to cancel long-running job {job.job_id}: {e}") + + _log.info( + f"Cancelling long-running job {job.job_id} (after {elapsed}, running since {job_running_start_time})" + ) + job.stop() + except Exception as e: _log.error(f"Unexpected error while handling job {job.job_id}: {e}")