octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #60264] Octave error messages omit filename, t


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #60264] Octave error messages omit filename, thus locating error is difficult
Date: Tue, 6 Dec 2022 15:44:14 -0500 (EST)

Follow-up Comment #1, bug #60264 (project octave):

note that what is reported also depends on what type of file the error is
triggered in, see bug #60466. E.g., for the following test classdef class:


classdef myclass
  properties
  end

  methods
    function obj = testfun (obj, errortype)
      switch (errortype)
        case 1
          error ('my error');
        case 2
          [a,b,c] = ls ();
        case 3
          tt = sprintf ('format string %s', { } );
      end
    end
  end
end


in Octave 8.0.1:

>> x = myclass
x =

  myclass object with properties:


>> testfun(x,1)
error: my error
error: called from
    testfun at line 9 column 11
>> testfun(x,2)
error: ls: function called with too many outputs
error: called from
    ls
    testfun at line 11 column 19
>> testfun(x,3)
error: sprintf: wrong type argument 'cell'


in Matlab 2022b:

>> x = myclass
x = 
  myclass with no properties.
>> testfun(x,1)
Error using myclass/testfun
my error 
>> testfun(x,2)
Error using ls
Too many output arguments.
Error in myclass/testfun (line 11)
          [a,b,c] = ls (); 
>> testfun(x,3)
Error using sprintf
Function is not defined for 'cell' inputs.
Error in myclass/testfun (line 13)
          tt = sprintf ('format string %s', { } ); 

(where each function/class name is a clickable link to either for functions
the documentation or for class methods it opens the m file in the editor.)



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60264>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]