changeset 23536:14b61de53028 stable

show stack trace for errors in command line and startup files (bug #49346) * interpreter.cc (safe_source_file): Display stack trace for execution errors.
author John W. Eaton <jwe@octave.org>
date Sun, 28 May 2017 12:01:02 -0400
parents e8287782064e
children 09205eeddbef 25817ecc6123
files libinterp/corefcn/interpreter.cc
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/interpreter.cc	Fri May 19 21:56:19 2017 -0400
+++ b/libinterp/corefcn/interpreter.cc	Sun May 28 12:01:02 2017 -0400
@@ -379,11 +379,14 @@
     {
       recover_from_exception ();
     }
-  catch (const octave::execution_exception&)
+  catch (const octave::execution_exception& ex)
     {
+      std::string stack_trace = ex.info ();
+
+      if (! stack_trace.empty ())
+        std::cerr << stack_trace;
+
       recover_from_exception ();
-
-      std::cerr << "error: execution exception in " << file_name << std::endl;
     }
 }