Add-on: handle submission errors more gracefully

This commit is contained in:
Sybren A. Stüvel 2022-08-25 13:28:45 +02:00
parent 22aa041ec1
commit f82ebea11d

View File

@ -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(