Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publisher: handling of exceptions on publish #949

Open
2 tasks done
antirotor opened this issue Oct 10, 2024 · 2 comments
Open
2 tasks done

Publisher: handling of exceptions on publish #949

antirotor opened this issue Oct 10, 2024 · 2 comments
Labels
type: enhancement Improvement of existing functionality or minor addition

Comments

@antirotor
Copy link
Member

Is there an existing issue for this?

  • I have searched the existing issues.

Please describe the feature you have in mind and explain what the current shortcomings are?

Whenever you hit publish or validate buttons and something happens in underlaying host code (some exception happens) , there might not be any feedback at all, except the fact that the publishing never started.

How would you imagine the implementation of the feature?

We should probably catch exception somewhere here:

def _on_publish_clicked(self):
if self._save_changes(False):
self._set_publish_comment()
self._controller.publish()
def _set_footer_enabled(self, enabled):
self._save_btn.setEnabled(True)
self._reset_btn.setEnabled(True)
if enabled:
self._stop_btn.setEnabled(False)
self._validate_btn.setEnabled(True)
self._publish_btn.setEnabled(True)
else:
self._stop_btn.setEnabled(enabled)
self._validate_btn.setEnabled(enabled)
self._publish_btn.setEnabled(enabled)
def _on_publish_reset(self):
self._create_tab.setEnabled(True)
self._set_comment_input_visiblity(True)
self._set_publish_overlay_visibility(False)
self._set_publish_visibility(False)
self._update_publish_details_widget()

and perhaps display the exception itself using QtWidgets.QMessageBox.critical() or similar.

Are there any labels you wish to add?

  • I have added the relevant labels to the enhancement request.

Describe alternatives you've considered:

No response

Additional context:

No response

@antirotor antirotor added the type: enhancement Improvement of existing functionality or minor addition label Oct 10, 2024
@BigRoy
Copy link
Collaborator

BigRoy commented Oct 10, 2024

This would be very nice with a reproducable example actually. Any idea how to get that to fail?

@antirotor
Copy link
Member Author

This would be very nice with a reproducable example actually. Any idea how to get that to fail?

You can raise Exception in host.update_context_data() for example, that one is called before validate and publish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Improvement of existing functionality or minor addition
Projects
None yet
Development

No branches or pull requests

2 participants