mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
Merge pull request #1317 from tanh609/develop
Scene inventory tool: Update error more visible
This commit is contained in:
commit
7ad16ebdde
1 changed files with 8 additions and 5 deletions
|
|
@ -959,11 +959,13 @@ class SceneInventoryView(QtWidgets.QTreeView):
|
|||
remove_container(container)
|
||||
self.data_changed.emit()
|
||||
|
||||
def _show_version_error_dialog(self, version, item_ids):
|
||||
def _show_version_error_dialog(self, version, item_ids, exception):
|
||||
"""Shows QMessageBox when version switch doesn't work
|
||||
|
||||
Args:
|
||||
version: str or int or None
|
||||
item_ids (Iterable[str]): List of item ids to run the
|
||||
exception (Exception): Exception that occurred
|
||||
"""
|
||||
if version == -1:
|
||||
version_str = "latest"
|
||||
|
|
@ -988,10 +990,11 @@ class SceneInventoryView(QtWidgets.QTreeView):
|
|||
dialog.addButton(QtWidgets.QMessageBox.Cancel)
|
||||
|
||||
msg = (
|
||||
"Version update to '{}' failed as representation doesn't exist."
|
||||
"Version update to '{}' failed with the following error:\n"
|
||||
"{}."
|
||||
"\n\nPlease update to version with a valid representation"
|
||||
" OR \n use 'Switch Folder' button to change folder."
|
||||
).format(version_str)
|
||||
).format(version_str, exception)
|
||||
dialog.setText(msg)
|
||||
dialog.exec_()
|
||||
|
||||
|
|
@ -1105,10 +1108,10 @@ class SceneInventoryView(QtWidgets.QTreeView):
|
|||
container = containers_by_id[item_id]
|
||||
try:
|
||||
update_container(container, item_version)
|
||||
except AssertionError:
|
||||
except Exception as exc:
|
||||
log.warning("Update failed", exc_info=True)
|
||||
self._show_version_error_dialog(
|
||||
item_version, [item_id]
|
||||
item_version, [item_id], exc
|
||||
)
|
||||
finally:
|
||||
# Always update the scene inventory view, even if errors occurred
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue