From f82ebea11d2034daca2ea68e88317ca50805ce08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 25 Aug 2022 13:28:45 +0200 Subject: [PATCH] Add-on: handle submission errors more gracefully --- addon/flamenco/operators.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/addon/flamenco/operators.py b/addon/flamenco/operators.py index 09203a7a..2af06c54 100644 --- a/addon/flamenco/operators.py +++ b/addon/flamenco/operators.py @@ -5,7 +5,7 @@ import datetime import logging from pathlib import Path, PurePosixPath from typing import Optional, TYPE_CHECKING -from urllib3.exceptions import MaxRetryError +from urllib3.exceptions import HTTPError, MaxRetryError import bpy @@ -366,6 +366,12 @@ class FLAMENCO_OT_submit_job(FlamencoOpMixin, bpy.types.Operator): try: submitted_job = job_submission.submit_job(self.job, api_client) + except MaxRetryError as ex: + self.report({"ERROR"}, "Unable to reach Flamenco Manager") + return + except HTTPError as ex: + self.report({"ERROR"}, "Error communicating with Flamenco Manager: %s" % ex) + return except ApiException as ex: if ex.status == 412: self.report(