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

Exception handling from #27 does not function as expected #99

Open
aragilar opened this issue Jul 10, 2019 · 0 comments · May be fixed by #100
Open

Exception handling from #27 does not function as expected #99

aragilar opened this issue Jul 10, 2019 · 0 comments · May be fixed by #100

Comments

@aragilar
Copy link
Collaborator

Was digging to why I was getting errors like SystemError: x returned a result with an error set (x is a placeholder) from inside odes, it appears except -1/except? -1 doesn't behave like we expected (or at least how I expect it): it appears what it does is propagate the exception upwards when -1 is returned (rather than returning -1 on an exception). This means if you do raise an exception inside user code, you get weird SystemErrors which occur at the next "python" frame (which may be inside cython-compiled code). I think the solution is to remove the except tags and use try-except with Exception (or BaseException), and return the error code manually in the except statement. I guess we should ask about this on the one of the cython mailing lists?

@florian98765 Did you have an example of where the exception handling works? I currently have a short test which I'll provide as a PR which breaks for me, but if you have an working example it may help understand what's going on...

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 a pull request may close this issue.

1 participant