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

Propagating exceptions from MATLAB to Julia #157

Open
yakir12 opened this issue Feb 19, 2019 · 2 comments · May be fixed by #237
Open

Propagating exceptions from MATLAB to Julia #157

yakir12 opened this issue Feb 19, 2019 · 2 comments · May be fixed by #237

Comments

@yakir12
Copy link

yakir12 commented Feb 19, 2019

It would be great if exceptions inside Matlab would somehow propagate to Julia. Right now they might elicit some printout but they are silent otherwise:

using MATLAB
mat"""
xxx - 1 % no xxx variable present, the error is silent for Julia
$x = 2
"""
@assert x == 2 # clears fine, even though the Matlab code (silently) failed.
@yakir12
Copy link
Author

yakir12 commented May 10, 2019

Any ideas on how to handle this...?

@tqml
Copy link
Collaborator

tqml commented Feb 14, 2025

Hey @yakir12 !

Just discovered your issue comment. I think that might be a cool feature to have. I don't know of any exposed C-API that we could use, but maybe matlab functions like lasterror or MException.last could help.

https://de.mathworks.com/help/matlab/ref/lasterror.html
https://de.mathworks.com/help/matlab/ref/mexception.html

@tqml tqml assigned tqml and unassigned tqml Feb 20, 2025
@tqml tqml linked a pull request Feb 20, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants