mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
OP-2736 - fail gracefully if slack exception
This commit is contained in:
parent
e3c6cb78ed
commit
eca57b03d6
1 changed files with 7 additions and 0 deletions
|
|
@ -60,6 +60,9 @@ class IntegrateSlackAPI(pyblish.api.InstancePlugin):
|
|||
message,
|
||||
publish_files)
|
||||
|
||||
if not msg_id:
|
||||
return
|
||||
|
||||
msg = {
|
||||
"type": "slack",
|
||||
"msg_id": msg_id,
|
||||
|
|
@ -177,6 +180,8 @@ class IntegrateSlackAPI(pyblish.api.InstancePlugin):
|
|||
error_str = self._enrich_error(str(e), channel)
|
||||
self.log.warning("Error happened: {}".format(error_str))
|
||||
|
||||
return None, []
|
||||
|
||||
def _python3_call(self, token, channel, message, publish_files):
|
||||
from slack_sdk import WebClient
|
||||
from slack_sdk.errors import SlackApiError
|
||||
|
|
@ -206,6 +211,8 @@ class IntegrateSlackAPI(pyblish.api.InstancePlugin):
|
|||
error_str = self._enrich_error(str(e.response["error"]), channel)
|
||||
self.log.warning("Error happened {}".format(error_str))
|
||||
|
||||
return None, []
|
||||
|
||||
def _enrich_error(self, error_str, channel):
|
||||
"""Enhance known errors with more helpful notations."""
|
||||
if 'not_in_channel' in error_str:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue