Mercurial > octave-libtiff
changeset 20726:25d676f9619c
Preface error() messages with name of function when possible.
* FIRfilter.m, subsasgn.m, get.m, polynomial.m, polynomial_superiorto.m,
set.m, subsasgn.m, subsref.m, Cell.cc, data.cc, graphics.in.h, toplev.cc,
urlwrite.cc, audiodevinfo.cc, symbfact.cc, CollocWt.cc, inputParser.m,
narginchk.m, nargoutchk.m, uicontrol.m, rgb2ind.m, textread.m, open.m,
__w2mpth__.m, fminbnd.m, pkg.m, pan.m, printd.m, rotate3d.m, zoom.m, eigs.m,
validatestring.m, __run_test_suite__.m, runtests.m, test.m:
Preface error() messages with name of function when possible.
line wrap: on
line diff
--- a/examples/code/@FIRfilter/FIRfilter.m Thu Nov 19 15:46:40 2015 -0500 +++ b/examples/code/@FIRfilter/FIRfilter.m Thu Nov 19 14:17:45 2015 -0800 @@ -11,7 +11,7 @@ p = @polynomial ([1]); elseif (nargin == 1) if (!isa (p, "polynomial")) - error ("FIRfilter: expecting polynomial as input argument"); + error ("@FIRfilter: expecting polynomial as input argument"); endif else print_usage ();
--- a/examples/code/@FIRfilter/subsasgn.m Thu Nov 19 15:46:40 2015 -0500 +++ b/examples/code/@FIRfilter/subsasgn.m Thu Nov 19 14:17:45 2015 -0800 @@ -6,9 +6,9 @@ out = f; out.polynomial = val; else - error ("@FIRfilter/subsref: invalid property \"%s\"", fld); + error ("@FIRfilter/subsasgn: invalid property \"%s\"", fld); endif otherwise - error ("FIRfilter/subsagn: Invalid index type") + error ("@FIRfilter/subsasgn: Invalid index type") endswitch endfunction
--- a/examples/code/@polynomial/get.m Thu Nov 19 15:46:40 2015 -0500 +++ b/examples/code/@polynomial/get.m Thu Nov 19 14:17:45 2015 -0800 @@ -7,10 +7,10 @@ case "poly" s = p.poly; otherwise - error ("get: invalid property %s", f); + error ("@polynomial/get: invalid property %s", f); endswitch else - error ("get: expecting the property to be a string"); + error ("@polynomial/get: expecting the property to be a string"); endif else print_usage ();
--- a/examples/code/@polynomial/polynomial.m Thu Nov 19 15:46:40 2015 -0500 +++ b/examples/code/@polynomial/polynomial.m Thu Nov 19 14:17:45 2015 -0800 @@ -22,7 +22,7 @@ p.poly = a(:).'; p = class (p, "polynomial"); else - error ("polynomial: expecting real vector"); + error ("@polynomial: expecting real vector"); endif else print_usage ();
--- a/examples/code/@polynomial/polynomial_superiorto.m Thu Nov 19 15:46:40 2015 -0500 +++ b/examples/code/@polynomial/polynomial_superiorto.m Thu Nov 19 14:17:45 2015 -0800 @@ -22,7 +22,7 @@ p.poly = a(:).'; p = class (p, "polynomial"); else - error ("polynomial: expecting real vector"); + error ("@polynomial: expecting real vector"); endif else print_usage ();
--- a/examples/code/@polynomial/set.m Thu Nov 19 15:46:40 2015 -0500 +++ b/examples/code/@polynomial/set.m Thu Nov 19 14:17:45 2015 -0800 @@ -1,7 +1,7 @@ function s = set (p, varargin) s = p; if (length (varargin) < 2 || rem (length (varargin), 2) != 0) - error ("set: expecting property/value pairs"); + error ("@polynomial/set: expecting property/value pairs"); endif while (length (varargin) > 1) prop = varargin{1}; @@ -11,10 +11,10 @@ if (isvector (val) && isreal (val)) s.poly = val(:).'; else - error ("set: expecting the value to be a real vector"); + error ("@polynomial/set: expecting the value to be a real vector"); endif else - error ("set: invalid property of polynomial class"); + error ("@polynomial/set: invalid property of polynomial class"); endif endwhile endfunction
--- a/examples/code/@polynomial/subsasgn.m Thu Nov 19 15:46:40 2015 -0500 +++ b/examples/code/@polynomial/subsasgn.m Thu Nov 19 14:17:45 2015 -0800 @@ -1,12 +1,12 @@ function p = subsasgn (p, s, val) if (length (s) < 1) - error ("polynomial: needs index"); + error ("@polynomial/subsasgn: needs index"); endif switch (s(1).type) case "{}" ind = s(1).subs; if (numel (ind) != 1) - error ("polynomial: need exactly one index"); + error ("@polynomial/subsasgn: need exactly one index"); else if (length (s) == 1) if (isnumeric (ind{1})) @@ -15,7 +15,7 @@ p.poly(ind{1}) = val; endif else - error ("polynomial: chained subscripts not allowed for {}"); + error ("@polynomial/subsasgn: chained subscripts not allowed for {}"); endif endif case "." @@ -27,9 +27,9 @@ p.poly = subsasgn (p.poly, s(2:end), val); endif else - error ("@polynomial/subsref: invalid property \"%s\"", fld); + error ("@polynomial/subsasgn: invalid property \"%s\"", fld); endif otherwise - error ("invalid subscript type"); + error ("@polynomial/subsasgn: invalid subscript type"); endswitch endfunction
--- a/examples/code/@polynomial/subsref.m Thu Nov 19 15:46:40 2015 -0500 +++ b/examples/code/@polynomial/subsref.m Thu Nov 19 14:17:45 2015 -0800 @@ -1,19 +1,19 @@ function b = subsref (a, s) if (isempty (s)) - error ("polynomial: missing index"); + error ("@polynomial/subsref: missing index"); endif switch (s(1).type) case "()" ind = s(1).subs; if (numel (ind) != 1) - error ("polynomial: need exactly one index"); + error ("@polynomial/subsref: need exactly one index"); else b = polyval (fliplr (a.poly), ind{1}); endif case "{}" ind = s(1).subs; if (numel (ind) != 1) - error ("polynomial: need exactly one index"); + error ("@polynomial/subsref: need exactly one index"); else if (isnumeric (ind{1})) b = a.poly(ind{1}+1); @@ -29,7 +29,7 @@ error ("@polynomial/subsref: invalid property \"%s\"", fld); endif otherwise - error ("invalid subscript type"); + error ("@polynomial/subsref: invalid subscript type"); endswitch if (numel (s) > 1) b = subsref (b, s(2:end));
--- a/libinterp/corefcn/Cell.cc Thu Nov 19 15:46:40 2015 -0500 +++ b/libinterp/corefcn/Cell.cc Thu Nov 19 14:17:45 2015 -0800 @@ -305,7 +305,7 @@ } } else - error ("Cell::column: requires 2-d cell array"); + error ("Cell::column: requires 2-D cell array"); return retval; }
--- a/libinterp/corefcn/data.cc Thu Nov 19 15:46:40 2015 -0500 +++ b/libinterp/corefcn/data.cc Thu Nov 19 14:17:45 2015 -0800 @@ -1851,8 +1851,7 @@ if (fcn.is_defined ()) { - // Have method for dominant type, so call it and let it handle - // conversions. + // Have method for dominant type. Call it and let it handle conversions. octave_value_list tmp2 = fcn.do_multi_index_op (1, ovl); @@ -5277,8 +5276,8 @@ %!error <must be scalars or vectors> linspace (1, [], 3) */ -// FIXME: should accept dimensions as separate args for N-d -// arrays as well as 1-d and 2-d arrays. +// FIXME: should accept dimensions as separate args for N-D +// arrays as well as 1-D and 2-D arrays. DEFUN (resize, args, , "-*- texinfo -*-\n\ @@ -7717,16 +7716,16 @@ if (args(1).is_scalar_type ()) order = args(1).idx_type_value (true, false); else if (! args(1).is_zero_by_zero ()) - error ("order K must be a scalar or []"); + error ("diff: order K must be a scalar or []"); if (order < 0) - error ("order K must be non-negative"); + error ("diff: order K must be non-negative"); } if (nargin > 2) { dim = args(2).int_value (true, false); if (dim < 1 || dim > args(0).ndims ()) - error ("DIM must be a valid dimension"); + error ("diff: DIM must be a valid dimension"); else dim -= 1; }
--- a/libinterp/corefcn/graphics.in.h Thu Nov 19 15:46:40 2015 -0500 +++ b/libinterp/corefcn/graphics.in.h Thu Nov 19 14:17:45 2015 -0800 @@ -1136,7 +1136,7 @@ Matrix rgb (void) const { if (current_type != color_t) - error ("color has no rgb value"); + error ("color has no RGB value"); return color_val.rgb (); }
--- a/libinterp/corefcn/toplev.cc Thu Nov 19 15:46:40 2015 -0500 +++ b/libinterp/corefcn/toplev.cc Thu Nov 19 14:17:45 2015 -0800 @@ -965,7 +965,7 @@ retval(0) = cmd_status; } else - error ("unable to start subprocess for '%s'", cmd_str.c_str ()); + error ("system: unable to start subprocess for '%s'", cmd_str.c_str ()); return retval; } @@ -1113,7 +1113,7 @@ CloseHandle (pi.hThread); } #else - error ("asynchronous system calls are not supported"); + error ("system: asynchronous system calls are not supported"); #endif } else if (return_output)
--- a/libinterp/corefcn/urlwrite.cc Thu Nov 19 15:46:40 2015 -0500 +++ b/libinterp/corefcn/urlwrite.cc Thu Nov 19 14:17:45 2015 -0800 @@ -192,7 +192,7 @@ if (obj.is_valid ()) handle_map[h] = obj; else - error ("support for url transfers was disabled when Octave was built"); + error ("support for URL transfers was disabled when Octave was built"); return h; } @@ -421,7 +421,7 @@ error ("urlwrite: %s", curl.lasterror ().c_str ()); } else - error ("support for url transfers was disabled when Octave was built"); + error ("support for URL transfers was disabled when Octave was built"); return retval; } @@ -526,7 +526,7 @@ error ("urlread: %s", curl.lasterror().c_str()); } else - error ("support for url transfers was disabled when Octave was built"); + error ("support for URL transfers was disabled when Octave was built"); return retval; }
--- a/libinterp/dldfcn/audiodevinfo.cc Thu Nov 19 15:46:40 2015 -0500 +++ b/libinterp/dldfcn/audiodevinfo.cc Thu Nov 19 14:17:45 2015 -0800 @@ -381,7 +381,7 @@ if (! device_info) { - error ("invalid audio device ID = %d", id); + error ("audiodevinfo: invalid audio device ID = %d", id); return retval; }
--- a/libinterp/dldfcn/symbfact.cc Thu Nov 19 15:46:40 2015 -0500 +++ b/libinterp/dldfcn/symbfact.cc Thu Nov 19 14:17:45 2015 -0800 @@ -221,16 +221,16 @@ CHOLMOD_NAME(etree) (Aup, Parent, cm); if (cm->status < CHOLMOD_OK) - error ("matrix corrupted"); + error ("symbfact: matrix corrupted"); if (CHOLMOD_NAME(postorder) (Parent, n, 0, Post, cm) != n) - error ("postorder failed"); + error ("symbfact: postorder failed"); CHOLMOD_NAME(rowcolcounts) (Alo, 0, 0, Parent, Post, 0, ColCount, First, Level, cm); if (cm->status < CHOLMOD_OK) - error ("matrix corrupted"); + error ("symbfact: matrix corrupted"); if (nargout > 4) {
--- a/liboctave/numeric/CollocWt.cc Thu Nov 19 15:46:40 2015 -0500 +++ b/liboctave/numeric/CollocWt.cc Thu Nov 19 14:17:45 2015 -0800 @@ -375,7 +375,7 @@ void CollocWt::error (const char* msg) { - (*current_liboctave_error_handler) ("fatal CollocWt error: %s", msg); + (*current_liboctave_error_handler) ("CollocWt: fatal error '%s'", msg); } CollocWt& @@ -383,7 +383,7 @@ { if (val >= rb) { - error ("left bound greater than right bound"); + error ("CollocWt: left bound greater than right bound"); return *this; } @@ -397,7 +397,7 @@ { if (val <= lb) { - error ("right bound less than left bound"); + error ("CollocWt: right bound less than left bound"); return *this; } @@ -414,7 +414,7 @@ double wid = rb - lb; if (wid <= 0.0) { - error ("width less than or equal to zero"); + error ("CollocWt: width less than or equal to zero"); return; } @@ -422,7 +422,7 @@ if (nt < 0) { - error ("total number of collocation points less than zero"); + error ("CollocWt: total number of collocation points less than zero"); return; } else if (nt == 0)
--- a/scripts/general/inputParser.m Thu Nov 19 15:46:40 2015 -0500 +++ b/scripts/general/inputParser.m Thu Nov 19 14:17:45 2015 -0800 @@ -328,7 +328,7 @@ if (this.FunctionName) print_usage (this.FunctionName); else - this.error ("not enough input arguments"); + this.error ("inputParser.parse: not enough input arguments"); endif endif pnargin = numel (varargin);
--- a/scripts/general/narginchk.m Thu Nov 19 15:46:40 2015 -0500 +++ b/scripts/general/narginchk.m Thu Nov 19 14:17:45 2015 -0800 @@ -39,19 +39,19 @@ if (nargin != 2) print_usage; elseif (! isnumeric (minargs) || ! isscalar (minargs)) - error ("minargs must be a numeric scalar"); + error ("narginchk: minargs must be a numeric scalar"); elseif (! isnumeric (maxargs) || ! isscalar (maxargs)) - error ("maxargs must be a numeric scalar"); + error ("narginchk: maxargs must be a numeric scalar"); elseif (minargs > maxargs) - error ("minargs cannot be larger than maxargs"); + error ("narginchk: minargs cannot be larger than maxargs"); endif args = evalin ("caller", "nargin;"); if (args < minargs) - error ("not enough input arguments"); + error ("narginchk: not enough input arguments"); elseif (args > maxargs) - error ("too many input arguments"); + error ("narginchk: too many input arguments"); endif endfunction
--- a/scripts/general/nargoutchk.m Thu Nov 19 15:46:40 2015 -0500 +++ b/scripts/general/nargoutchk.m Thu Nov 19 14:17:45 2015 -0800 @@ -84,19 +84,19 @@ elseif (nargout == 0 && nargin == 2) if (! isnumeric (minargs) || ! isscalar (minargs)) - error ("minargs must be a numeric scalar"); + error ("nargoutchk: minargs must be a numeric scalar"); elseif (! isnumeric (maxargs) || ! isscalar (maxargs)) - error ("maxargs must be a numeric scalar"); + error ("nargoutchk: maxargs must be a numeric scalar"); elseif (minargs > maxargs) - error ("minargs cannot be larger than maxargs"); + error ("nargoutchk: minargs cannot be larger than maxargs"); endif args = evalin ("caller", "nargout;"); if (args < minargs) - error ("Not enough output arguments."); + error ("nargoutchk: Not enough output arguments."); elseif (args > maxargs) - error ("Too many output arguments."); + error ("nargoutchk: Too many output arguments."); endif else
--- a/scripts/gui/uicontrol.m Thu Nov 19 15:46:40 2015 -0500 +++ b/scripts/gui/uicontrol.m Thu Nov 19 14:17:45 2015 -0800 @@ -102,7 +102,7 @@ if (nargin == 1 && ishandle (varargin{1}) && strcmpi (get (varargin{1}, "type"), "uicontrol")) - error ("uicontrol focusing not implemented yet."); + error ("uicontrol: focusing not implemented yet"); endif [h, args] = __uiobject_split_args__ ("uicontrol", varargin,
--- a/scripts/image/rgb2ind.m Thu Nov 19 15:46:40 2015 -0500 +++ b/scripts/image/rgb2ind.m Thu Nov 19 14:17:45 2015 -0800 @@ -82,7 +82,7 @@ case "int16" map = (double (im) + 32768) / 65535; otherwise - error ("unsupported image class %s", im_class); + error ("rgb2ind: unsupported image class %s", im_class); endswitch ## we convert to the smallest class necessary to encode the image. Matlab
--- a/scripts/io/textread.m Thu Nov 19 15:46:40 2015 -0500 +++ b/scripts/io/textread.m Thu Nov 19 14:17:45 2015 -0800 @@ -144,7 +144,7 @@ ## Beware of missing or wrong headerline value if (headerlines == numel (varargin) || ! isnumeric (varargin{headerlines + 1})) - error ("missing or illegal value for 'headerlines'" ); + error ("textread: missing or invalid value for 'headerlines'" ); endif ## Avoid conveying floats to fskipl varargin{headerlines + 1} = round (varargin{headerlines + 1}); @@ -172,10 +172,10 @@ if (ischar (varargin{endofline + 1})) eol_char = varargin{endofline + 1}; if (! any (strcmp (eol_char, {"", "\n", "\r", "\r\n"}))) - error ("textscan: illegal EndOfLine character value specified"); + error ("textread: invalid EndOfLine character value specified"); endif else - error ("character value required for EndOfLine"); + error ("textread: character value required for EndOfLine"); endif else ## Determine EOL from file. @@ -491,7 +491,7 @@ %!error textread (1) %!error <arguments must be strings> textread (1, "%f") %!error <arguments must be strings> textread ("fname", 1) -%!error <missing or illegal value for> textread (file_in_loadpath ("textread.m"), "", "headerlines") -%!error <missing or illegal value for> textread (file_in_loadpath ("textread.m"), "", "headerlines", 'hh') +%!error <missing or invalid value for> textread (file_in_loadpath ("textread.m"), "", "headerlines") +%!error <missing or invalid value for> textread (file_in_loadpath ("textread.m"), "", "headerlines", 'hh') %!error <character value required for> textread (file_in_loadpath ("textread.m"), "%s", "endofline", true)
--- a/scripts/miscellaneous/open.m Thu Nov 19 15:46:40 2015 -0500 +++ b/scripts/miscellaneous/open.m Thu Nov 19 14:17:45 2015 -0800 @@ -59,12 +59,12 @@ evalin ("base", sprintf ("load ('%s');", file)); endif elseif (any (strcmpi (ext, {".fig", ".mdl", ".slx", ".prj"}))) - error ("opening file type '%s' is not supported", ext); + error ("open: opening file type '%s' is not supported", ext); elseif (strcmpi (ext, ".exe")) if (ispc ()) dos (file); else - error ("executing .exe files is only supported on Windows systems"); + error ("open: executing .exe files is only supported on Windows systems"); endif else __open_with_system_app__ (file); @@ -72,7 +72,9 @@ endfunction + ## Test input validation -%!error open -%!error open (1) -%!error output = open (1) +%!error open () +%!error open ("abc", "def") +%!error <FILE must be a string> open (1) +
--- a/scripts/miscellaneous/private/__w2mpth__.m Thu Nov 19 15:46:40 2015 -0500 +++ b/scripts/miscellaneous/private/__w2mpth__.m Thu Nov 19 14:17:45 2015 -0800 @@ -47,7 +47,7 @@ ## Check for platform if (! ispc) - error ("__w2mpth__ should only be called on Windows platforms\n"); + error ("__w2mpth__: function must only be called on Windows platforms\n"); endif ## Replace backslash file separators by forward slashes
--- a/scripts/optimization/fminbnd.m Thu Nov 19 15:46:40 2015 -0500 +++ b/scripts/optimization/fminbnd.m Thu Nov 19 14:17:45 2015 -0800 @@ -278,7 +278,7 @@ case -1 "FIXME"; # FIXME: what's the message MATLAB prints for this case? otherwise - error ("internal error - fminbnd() is bug, sorry!"); + error ("fminbnd: internal error, info return code was %d", info); endswitch printf ("\n"); endfunction
--- a/scripts/pkg/pkg.m Thu Nov 19 15:46:40 2015 -0500 +++ b/scripts/pkg/pkg.m Thu Nov 19 14:17:45 2015 -0800 @@ -352,7 +352,7 @@ endif case available_actions if (! strcmp (action, "none")) - error ("more than one action specified"); + error ("pkg: more than one action specified"); endif action = varargin{i}; otherwise @@ -361,7 +361,7 @@ endfor if (octave_forge && ! any (strcmp (action, {"install", "list"}))) - error ("-forge can only be used with install or list"); + error ("pkg: '-forge' can only be used with install or list"); endif ## Take action @@ -387,7 +387,7 @@ case "install" if (isempty (files)) - error ("you must specify at least one filename when calling 'pkg install'"); + error ("pkg: install action requires at least one filename"); endif local_files = {}; @@ -401,7 +401,7 @@ succ = [succ{:}]; if (! all (succ)) i = find (! succ, 1); - error ("could not download file %s from url %s", + error ("pkg: could not download file %s from url %s", local_files{i}, urls{i}); endif endif @@ -415,19 +415,19 @@ case "uninstall" if (isempty (files)) - error ("you must specify at least one package when calling 'pkg uninstall'"); + error ("pkg: uninstall action requires at least one package name"); endif uninstall (files, deps, verbose, local_list, global_list, global_install); case "load" if (isempty (files)) - error ("you must specify at least one package, 'all', or 'auto' when calling 'pkg load'"); + error ("pkg: load action requires at least one package, 'all', or 'auto'"); endif load_packages (files, deps, local_list, global_list); case "unload" if (isempty (files)) - error ("you must specify at least one package or 'all' when calling 'pkg unload'"); + error ("pkg: unload action requires at least one package or 'all'"); endif unload_packages (files, deps, local_list, global_list); @@ -443,7 +443,7 @@ if (! exist (prefix, "dir")) [status, msg] = mkdir (prefix); if (status == 0) - error ("cannot create prefix %s: %s", prefix, msg); + error ("pkg: cannot create prefix %s: %s", prefix, msg); endif warning ("creating the directory %s\n", prefix); endif @@ -454,14 +454,14 @@ if (! exist (archprefix, "dir")) [status, msg] = mkdir (archprefix); if (status == 0) - error ("cannot create archprefix %s: %s", archprefix, msg); + error ("pkg: cannot create archprefix %s: %s", archprefix, msg); endif warning ("creating the directory %s\n", archprefix); global_packages = archprefix = canonicalize_file_name (archprefix); endif endif else - error ("you must specify a prefix directory, or request an output argument"); + error ("pkg: prefix action requires a directory input, or an output argument"); endif case "local_list" @@ -476,12 +476,12 @@ ## Force file to be created fclose (fopen (local_list, "wt")); catch - error ("cannot create file %s", local_list); + error ("pkg: cannot create file %s", local_list); end_try_catch endif local_list = canonicalize_file_name (local_list); else - error ("you must specify a local_list file, or request an output argument"); + error ("pkg: specify a local_list file, or request an output argument"); endif case "global_list" @@ -496,12 +496,12 @@ ## Force file to be created fclose (fopen (files{1}, "wt")); catch - error ("cannot create file %s", global_list); + error ("pkg: cannot create file %s", global_list); end_try_catch endif global_list = canonicalize_file_name (global_list); else - error ("you must specify a global_list file, or request an output argument"); + error ("pkg: specify a global_list file, or request an output argument"); endif case "rebuild" @@ -525,13 +525,13 @@ case "build" if (numel (files) < 2) - error ("you must specify at least the build directory and one filename\nwhen calling 'pkg build'"); + error ("pkg: build action requires build directory and at least one filename"); endif build (files, deps, auto, verbose); case "describe" if (isempty (files)) - error ("you must specify at least one package or 'all' when calling 'pkg describe'"); + error ("pkg: describe action requires at least one package or 'all'"); endif ## FIXME: name of the output variables is inconsistent with their content if (nargout) @@ -566,7 +566,7 @@ endfor otherwise - error ("you must specify a valid action for 'pkg'. See 'help pkg' for details"); + error ("pkg: invalid action. See 'help pkg' for available actions"); endswitch endfunction
--- a/scripts/plot/util/pan.m Thu Nov 19 15:46:40 2015 -0500 +++ b/scripts/plot/util/pan.m Thu Nov 19 14:17:45 2015 -0800 @@ -50,7 +50,7 @@ endif if (nargin == 1 && nargout > 0 && isfigure (varargin{1})) - error ("pan_object_handle = pan (hfig): not implemented"); + error ("pan: syntax 'handle = pan (hfig)' not implemented"); endif if (nargs == 2)
--- a/scripts/plot/util/printd.m Thu Nov 19 15:46:40 2015 -0500 +++ b/scripts/plot/util/printd.m Thu Nov 19 14:17:45 2015 -0800 @@ -43,7 +43,7 @@ ## Extract .suffix from filename if ((sufix = rindex (filename, ".")) <= 0) - error ("The output filename: %s requires a suffix.\nOptions are: pdf ps eps txt jpg jpeg", filename); + error ("printd: output filename '%s' requires a suffix.\nOptions are: pdf ps eps txt jpg jpeg", filename); endif opt = substr (filename, sufix+1); [pf, tempf, mag] = mkstemp ("oct-XXXXXX", 1); @@ -76,7 +76,7 @@ otherwise fclose (pf); delete (tempf); - error ("Unknown conversion type: %s.\nOptions are: pdf ps eps txt jpg jpeg", opt); + error ("printd: unknown conversion type: %s.\nOptions are: pdf ps eps txt jpg jpeg", opt); endswitch fclose (pf);
--- a/scripts/plot/util/rotate3d.m Thu Nov 19 15:46:40 2015 -0500 +++ b/scripts/plot/util/rotate3d.m Thu Nov 19 14:17:45 2015 -0800 @@ -45,7 +45,7 @@ endif if (nargin == 1 && nargout > 0 && isfigure (varargin{1})) - error ("rotate_object_handle = rotate3d (hfig): not implemented"); + error ("rotate3d: syntax 'handle = rotate3d (hfig)' not implemented"); endif if (nargs == 2)
--- a/scripts/plot/util/zoom.m Thu Nov 19 15:46:40 2015 -0500 +++ b/scripts/plot/util/zoom.m Thu Nov 19 14:17:45 2015 -0800 @@ -65,7 +65,7 @@ endif if (nargs == 1 && nargout > 0 && isfigure (varargin{1})) - error ("zoom_object_handle = zoom (hfig): not implemented"); + error ("zoom: syntax 'handle = zoom (hfig)' not implemented"); endif hfig = NaN;
--- a/scripts/sparse/eigs.m Thu Nov 19 15:46:40 2015 -0500 +++ b/scripts/sparse/eigs.m Thu Nov 19 14:17:45 2015 -0800 @@ -286,53 +286,53 @@ if (real_valued && symmetric) [~, idx] = sort (real (d), "descend"); else - error ('sigma = "la" requires real symmetric problem'); + error ('eigs: sigma = "la" requires real symmetric problem'); endif case "sa" if (real_valued && symmetric) [~, idx] = sort (real (d), "ascend"); else - error ('sigma = "sa" requires real symmetric problem'); + error ('eigs: sigma = "sa" requires real symmetric problem'); endif case "be" if (real_valued && symmetric) [~, idx] = sort (real (d), "ascend"); else - error ('sigma = "be" requires real symmetric problem'); + error ('eigs: sigma = "be" requires real symmetric problem'); endif case "lr" if (! (real_valued || symmetric)) [~, idx] = sort (real (d), "descend"); else - error ('sigma = "lr" requires complex or unsymmetric problem'); + error ('eigs: sigma = "lr" requires complex or unsymmetric problem'); endif case "sr" if (! (real_valued || symmetric)) [~, idx] = sort (real (d), "ascend"); else - error ('sigma = "sr" requires complex or unsymmetric problem'); + error ('eigs: sigma = "sr" requires complex or unsymmetric problem'); endif case "li" if (! (real_valued || symmetric)) [~, idx] = sort (imag (d), "descend"); else - error ('sigma = "li" requires complex or unsymmetric problem'); + error ('eigs: sigma = "li" requires complex or unsymmetric problem'); endif case "si" if (! (real_valued || symmetric)) [~, idx] = sort (imag (d), "ascend"); else - error ('sigma = "si" requires complex or unsymmetric problem'); + error ('eigs: sigma = "si" requires complex or unsymmetric problem'); endif otherwise - error ("unrecognized value for sigma: %s", sigma); + error ("eigs: unrecognized value for sigma: %s", sigma); endswitch else ## numeric sigma, find k closest values
--- a/scripts/strings/validatestring.m Thu Nov 19 15:46:40 2015 -0500 +++ b/scripts/strings/validatestring.m Thu Nov 19 14:17:45 2015 -0800 @@ -114,7 +114,7 @@ matches = strncmpi (str, strarray(:), length (str)); nmatches = sum (matches); if (nmatches == 0) - error ("%sdoes not match any of\n%s", errstr, + error ("validatestring: %sdoes not match any of\n%s", errstr, sprintf ("%s, ", strarray{:})(1:end-2)); elseif (nmatches == 1) str = strarray{matches}; @@ -129,7 +129,7 @@ if (all (submatch)) str = short_str; else - error ("%sallows multiple unique matches:\n%s", + error ("validatestring: %sallows multiple unique matches:\n%s", errstr, sprintf ("%s, ", strarray{match_idx})(1:end-2)); endif endif
--- a/scripts/testfun/__run_test_suite__.m Thu Nov 19 15:46:40 2015 -0500 +++ b/scripts/testfun/__run_test_suite__.m Thu Nov 19 14:17:45 2015 -0800 @@ -50,7 +50,7 @@ try fid = fopen (logfile, "wt"); if (fid < 0) - error ("could not open %s for writing", logfile); + error ("__run_test_suite__: could not open %s for writing", logfile); endif test ("", "explain", fid); dp = dn = dxf = dsk = 0; @@ -160,7 +160,7 @@ retval = ! isempty (regexp (str,'^(DEFUN|DEFUN_DLD)\>', 'lineanchors', 'once')); else - error ("fopen failed: %s", f); + error ("__run_test_suite__: fopen failed: %s", f); endif elseif (n > 2 && strcmpi (f((end-1):end), ".m")) retval = true; @@ -178,7 +178,7 @@ '^%!(assert|error|fail|test|xtest|warning)', 'lineanchors', 'once')); else - error ("fopen failed: %s", f); + error ("__run_test_suite__: fopen failed: %s", f); endif endfunction
--- a/scripts/testfun/runtests.m Thu Nov 19 15:46:40 2015 -0500 +++ b/scripts/testfun/runtests.m Thu Nov 19 14:17:45 2015 -0800 @@ -111,7 +111,7 @@ retval = ! isempty (regexp (str,'^(?:DEFUN|DEFUN_DLD|DEFUNX)\>', 'lineanchors', 'once')); else - error ("fopen failed: %s", f); + error ("runtests: fopen failed: %s", f); endif elseif (n > 2 && strcmpi (f((end-1):end), ".m")) retval = true;
--- a/scripts/testfun/test.m Thu Nov 19 15:46:40 2015 -0500 +++ b/scripts/testfun/test.m Thu Nov 19 14:17:45 2015 -0800 @@ -595,7 +595,7 @@ __success = false; endif if (isempty (lasterr ())) - error ("empty error text, probably Ctrl-C --- aborting"); + error ("test: empty error text, probably Ctrl-C --- aborting"); endif end_try_catch clear __test__;