lasterror (stack.name)

gOS bkirklin at quantapoint.com
Wed Jun 4 09:08:18 CDT 2008


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.
-- 
View this message in context: http://www.nabble.com/lasterror-%28stack.name%29-tp17647642p17647642.html
Sent from the Octave - General mailing list archive at Nabble.com.



More information about the Help-octave mailing list