Classdef error stack, should it indicate the class/method, or just the method?

playing around with a scatteredInterpolant class that has an overloaded subsref method, calling it improperly produces the following error:

>> A(1,2,3,4)
error: scatteredInterpolant: query points dimension must match interpolant
error: called from
    subsref at line 317 column 17

my error message has the class/mfilename in it, but the stacktrace just says the error lives in subsref, no reference to the classname. is that the preferred behavior? Note that a similar calling error in matlab produces:

>> A(1,2,3,4)
Error using scatteredInterpolant/subsref
Invalid arguments specified in evaluating the interpolant.

(didn’t see anything about error stack in the wiki or a quick bug search.)

I agree, the error should have more than just the function name. There should probably be a function that we could use when creating the error message that returns “class_name/method_name” for methods and “function_name” for ordinary functions.

Edit: I’m attaching a possible quick fix. Though as the FIXME comment says, I think it might be best to add a virtual function and some overloads to the octave_function class.

I think we had the discussion before, possibly related to how to pass function names to dbstop, but we need to agree on exactly how to format fully-qualified function names. Is it +pkg/fcn or pkg.fcn? What about pkg.cls/method? Private functions? Nested? And all possible combinations of these things. Then we need to use the same functions for display everywhere, and have functions like which and dbstop parse them correctly.

stack-frame-fcn-name-diffs.txt (1.2 KB)