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

ProcessMonitorWidget: Print traceback for callback exceptions #427

Merged
merged 8 commits into from
Feb 15, 2023

Conversation

danielhollas
Copy link
Contributor

Closes #386 (see the issue for details why this change is needed)

Before:

obrazek

After:

obrazek

NOTES:

  1. The warning is hidden in the Appmode. This can easily lead to user confusion, since something doesn't work but the error is hidden. Not sure if this is the best design, perhaps these exceptions should be raised instead. But that's beyond the point of this PR.
  2. This fix could (should?) be applied to the 1.x support branch.

@danielhollas
Copy link
Contributor Author

@yakutovicha here's a code snippet to test this in Jupyter Notebook

from aiida.orm import load_node
from aiidalab_widgets_base import ProcessMonitor

def raise_error():
    raise ValueError("We have a problem")

monitor = ProcessMonitor(
            timeout=0.5,
            callbacks=[
                raise_error,
            ],
)
process_pk = 1217
monitor.value = load_node(process_pk).uuid

Copy link
Member

@yakutovicha yakutovicha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @danielhollas. I just have a minor request.

aiidalab_widgets_base/process.py Outdated Show resolved Hide resolved
Co-authored-by: Aliaksandr Yakutovich <yakutovicha@gmail.com>
@danielhollas
Copy link
Contributor Author

@yakutovicha thanks, I've accepted your suggestion.

Once this is merged, could you please release a new beta version? I want to use this for better in my app for easier debugging.
Also the last beta version is broken for my app so it would be nice to publish the configure_tabs fix.

@yakutovicha
Copy link
Member

@yakutovicha thanks, I've accepted your suggestion.

Once this is merged, could you please release a new beta version?

sure, will do that right away

@yakutovicha yakutovicha merged commit 3c93889 into master Feb 15, 2023
@yakutovicha yakutovicha deleted the process-monitor-traceback branch February 15, 2023 16:21
unkcpz added a commit to unkcpz/aiidalab-widgets-base that referenced this pull request Nov 16, 2023
In order to use mbarkhau/bumpver#207 for backport compatibility support for branch `support-23.04.x`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Print tracebacks for disabled callbacks in ProcessMonitorWidget
2 participants