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

Panic on PruneSearch #1383

Open
barakatzir opened this issue Feb 10, 2025 · 1 comment
Open

Panic on PruneSearch #1383

barakatzir opened this issue Feb 10, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@barakatzir
Copy link
Contributor

When raising PruneSearch in the finish_vertex traversal event, the traversal methods raise PanicError.

I suggest raising RuntimeError instead. This properly inherits from Exception (and not only from BaseException) and has a specific type a user can try: ...; except RunimeError: ....

Panic also has a side effect of printing to stderr a panic message (other than the python-raised exception traceback).
I think this stderr message should be avoided if possible, but I'm not sure there is an easy solution for this (other than the breaking change of rustworkx-core not panicking).

This was raised in issue #1361, which was closed in PR #1375.
I guess this point got drowned in the documentation change discussions, so I'm opening a new issue for it here.
(The raised exception in the finish event was added to the rustworkx docs in that PR with the exception type unmentioned).

If there is already a PR for this, or this enhancement is unwanted feel free to close this issue.

@IvanIsCoding IvanIsCoding added the bug Something isn't working label Feb 10, 2025
@IvanIsCoding
Copy link
Collaborator

Yes, we marked the PR as closing the issue. Reopening is fine, we should track the unwanted panics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants