mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
Show message with error on action failure.
This commit is contained in:
parent
b921d4384d
commit
449e601a5f
2 changed files with 30 additions and 0 deletions
|
|
@ -2329,6 +2329,21 @@ class PublisherController(BasePublisherController):
|
|||
result = pyblish.plugin.process(
|
||||
plugin, self._publish_context, None, action.id
|
||||
)
|
||||
exception = result.get("error")
|
||||
if exception:
|
||||
self._emit_event(
|
||||
"action.failed",
|
||||
{
|
||||
"title": "Action failed",
|
||||
"message": "Action failed.",
|
||||
"traceback": "".join(
|
||||
traceback.format_exception(exception)
|
||||
),
|
||||
"label": "",
|
||||
"identifier": action.__name__
|
||||
}
|
||||
)
|
||||
|
||||
self._publish_report.add_action_result(action, result)
|
||||
|
||||
def _publish_next_process(self):
|
||||
|
|
|
|||
|
|
@ -321,6 +321,9 @@ class PublisherWindow(QtWidgets.QWidget):
|
|||
controller.event_system.add_callback(
|
||||
"convertors.find.failed", self._on_convertor_error
|
||||
)
|
||||
controller.event_system.add_callback(
|
||||
"action.failed", self._on_action_error
|
||||
)
|
||||
controller.event_system.add_callback(
|
||||
"export_report.request", self._export_report
|
||||
)
|
||||
|
|
@ -1012,6 +1015,18 @@ class PublisherWindow(QtWidgets.QWidget):
|
|||
event["title"], new_failed_info, "Convertor:"
|
||||
)
|
||||
|
||||
def _on_action_error(self, event):
|
||||
self.add_error_message_dialog(
|
||||
event["title"],
|
||||
[{
|
||||
"message": event["message"],
|
||||
"traceback": event["traceback"],
|
||||
"label": event["label"],
|
||||
"identifier": event["identifier"]
|
||||
}],
|
||||
"Action:"
|
||||
)
|
||||
|
||||
def _update_create_overlay_size(self):
|
||||
metrics = self._create_overlay_button.fontMetrics()
|
||||
height = int(metrics.height())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue