lasterror (stack.name)
John W. Eaton
jwe at bevo.che.wisc.edu
Wed Jun 4 10:44:26 CDT 2008
On 4-Jun-2008, gOS wrote:
|
| I've noticed that when I run a mex file (foo.mex) and have it call
| mexErrMsgIdAndTxt('component:mnemonic','message'), that I am receiving
| unexpected values from last error.
|
| For the sake of this example, assume moo.m calls foo.
|
| function moo
|
| output = foo(input)
| le = lasterror
|
| end
| =========================
|
| le =
| {
| message = error: foo: message
| identifier = component:mnemonic
| stack =
| {
| file = C:\file\blah\...\moo.m
| name = moo
| line = 3
| column = 8
| }
| }
|
| ===============
|
| As you can see, foo is referenced in the error message, but does not get
| credit in the stack. Instead, moo is determined to be the offending
| function. I understand line & column would not have values when referencing
| a mex function, but it makes writing a function like handleError() a little
| more difficult if I can't trust the stack to always return the correct
| information or if I have to parse message to find out what the actual
| function was that crashed.
|
| I suppose, its possible to program all the desired information into the
| identifier when using mex files, but I still wanted to check if this was the
| expected behavior.
What does Matlab do?
If you think you've found a bug, then please submit a complete bug
report to the bug at octave.org list, including the code necessary to
reproduce the error, so we don't have to guess or duplicate that
effort.
jwe
More information about the Help-octave
mailing list