Mon 05 Sep 2016 04:32:21 PM UTC, comment #2:
I actually conflated two issues in this bug report: one bug with mexCallMATLAB and a feature request with mexCallMATLABWithTrap.
- bug report concerning mexCallMATLAB:
The integer value returned by mexCallMATLAB is always 1 even if an error has been caught. This can be fixed with the following (this is what mexEvalString does):
- feature request for mexCallMATLABWithTrap:
Given that the try/catch ME currently returns a structure, the following could be used until a complete MException can be returned:
|
Tue 30 Aug 2016 01:37:27 PM UTC, comment #1:
I've just made the following tiny change:
and it now returns a non zero value when an error is caught. The error message is still being displayed though:
Maybe the same approach than the one used by @oheim in patch #8033 can be used here.
|
Tue 30 Aug 2016 10:42:32 AM UTC, original submission:
It seems that mexCallMATLABWithTrap is not available from the Octave API:
http://www.mathworks.com/help/matlab/apiref/mexcallmatlabwithtrap.html
I tried instead to use mexCallMATLAB with mexSetTrapFlag, even if its use is deprecated in MATLAB, as it seems to be implemented in Octave:
http://www.mathworks.com/help/matlab/apiref/mexsettrapflag.html
There seems to be an issue with the integer value returned by mexCallMATLAB though:
With mexSetTrapFlag(0), Octave gives:
With mexSetTrapFlag(0), MATLAB gives:
With mexSetTrapFlag(1), Octave gives:
With mexSetTrapFlag(1), MATLAB gives:
So it seems that when the Trap Flag is set to true, mexCallMATLAB is not set to a non-zero value when an error is caught.
From what I see, it seems that having an implementation of mexCallMATLABWithTrap might not be too difficult - the main issue being that MException is not implemented: what are the plans regarding this and should it be implemented in M-code or C++?
|