mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
Fixed issues after code review
Warning should print exception. JSONDecoder is not in Pype2
This commit is contained in:
parent
beedfd2ece
commit
fc4db8802d
1 changed files with 11 additions and 6 deletions
|
|
@ -16,7 +16,12 @@ import attr
|
|||
import requests
|
||||
|
||||
import pyblish.api
|
||||
from openpype.pipeline.publish import AbstractMetaInstancePlugin
|
||||
from openpype.pipeline.publish import (
|
||||
AbstractMetaInstancePlugin,
|
||||
KnownPublishError
|
||||
)
|
||||
|
||||
JSONDecodeError = getattr(json.decoder, "JSONDecodeError", ValueError)
|
||||
|
||||
|
||||
def requests_post(*args, **kwargs):
|
||||
|
|
@ -616,7 +621,7 @@ class AbstractSubmitDeadline(pyblish.api.InstancePlugin):
|
|||
str: resulting Deadline job id.
|
||||
|
||||
Throws:
|
||||
RuntimeError: if submission fails.
|
||||
KnownPublishError: if submission fails.
|
||||
|
||||
"""
|
||||
url = "{}/api/jobs".format(self._deadline_url)
|
||||
|
|
@ -626,15 +631,15 @@ class AbstractSubmitDeadline(pyblish.api.InstancePlugin):
|
|||
self.log.error(response.status_code)
|
||||
self.log.error(response.content)
|
||||
self.log.debug(payload)
|
||||
raise RuntimeError(response.text)
|
||||
raise KnownPublishError(response.text)
|
||||
|
||||
try:
|
||||
result = response.json()
|
||||
except json.decoder.JSONDecodeError:
|
||||
msg = "Broken response {}. ".format(response)
|
||||
msg += "Try restarting DL webservice"
|
||||
self.log.warning()
|
||||
raise RuntimeError("Broken response from DL")
|
||||
msg += "Try restarting the Deadline Webservice."
|
||||
self.log.warning(msg, exc_info=True)
|
||||
raise KnownPublishError("Broken response from DL")
|
||||
|
||||
# for submit publish job
|
||||
self._instance.data["deadlineSubmissionJob"] = result
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue