Mercurial > octave
changeset 23464:7eb0077e86f0 stable
show stack trace for wrong type arg errors (bug #50894)
* error.h, error.cc (make_execution_exception): Make public.
* errwarn.cc (err_user_supplied_eval, err_wrong_type_arg):
Initialize execution_exception object.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 28 Apr 2017 15:29:39 -0400 |
parents | 1bc0e610e293 |
children | 342e485c796d 0ada77ed24dd |
files | libinterp/corefcn/error.cc libinterp/corefcn/error.h libinterp/corefcn/errwarn.cc |
diffstat | 3 files changed, 12 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/error.cc Sat Apr 22 20:55:43 2017 -0700 +++ b/libinterp/corefcn/error.cc Fri Apr 28 15:29:39 2017 -0400 @@ -335,7 +335,7 @@ pr_where (os, who, frames); } -static octave::execution_exception +octave::execution_exception make_execution_exception (const char *who) { std::ostringstream buf;
--- a/libinterp/corefcn/error.h Sat Apr 22 20:55:43 2017 -0700 +++ b/libinterp/corefcn/error.h Fri Apr 28 15:29:39 2017 -0400 @@ -44,6 +44,9 @@ extern OCTINTERP_API int warning_enabled (const std::string& id); +extern OCTINTERP_API octave::execution_exception +make_execution_exception (const char *who); + extern OCTINTERP_API void vmessage (const char *name, const char *fmt, va_list args);
--- a/libinterp/corefcn/errwarn.cc Sat Apr 22 20:55:43 2017 -0700 +++ b/libinterp/corefcn/errwarn.cc Fri Apr 28 15:29:39 2017 -0400 @@ -141,7 +141,7 @@ void err_user_supplied_eval (const char *name) { - octave::execution_exception e; + octave::execution_exception e = make_execution_exception ("error"); err_user_supplied_eval (e, name); } @@ -155,7 +155,7 @@ void err_wrong_type_arg (const char *name, const char *s) { - octave::execution_exception e; + octave::execution_exception e = make_execution_exception ("error"); err_wrong_type_arg (e, name, s); } @@ -170,7 +170,7 @@ void err_wrong_type_arg (const char *name, const std::string& s) { - octave::execution_exception e; + octave::execution_exception e = make_execution_exception ("error"); err_wrong_type_arg (e, name, s.c_str ()); } @@ -185,7 +185,7 @@ void err_wrong_type_arg (const char *name, const octave_value& tc) { - octave::execution_exception e; + octave::execution_exception e = make_execution_exception ("error"); err_wrong_type_arg (e, name, tc); } @@ -202,7 +202,7 @@ void err_wrong_type_arg (const std::string& name, const octave_value& tc) { - octave::execution_exception e; + octave::execution_exception e = make_execution_exception ("error"); err_wrong_type_arg (e, name, tc); } @@ -217,7 +217,7 @@ void err_wrong_type_arg (const char *s) { - octave::execution_exception e; + octave::execution_exception e = make_execution_exception ("error"); err_wrong_type_arg (e, s); } @@ -231,7 +231,7 @@ void err_wrong_type_arg (const std::string& s) { - octave::execution_exception e; + octave::execution_exception e = make_execution_exception ("error"); err_wrong_type_arg (e, s); } @@ -245,7 +245,7 @@ void err_wrong_type_arg (const octave_value& tc) { - octave::execution_exception e; + octave::execution_exception e = make_execution_exception ("error"); err_wrong_type_arg (e, tc); }