changeset 23537:94968aa621a8

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:02:48 -0400
parents 2aab625b502c
children 09205eeddbef
files libinterp/corefcn/interpreter.cc
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/interpreter.cc	Tue May 23 15:01:27 2017 +0200
+++ b/libinterp/corefcn/interpreter.cc	Sun May 28 12:02:48 2017 -0400
@@ -328,8 +328,13 @@
 
       return 1;
     }
-  catch (const octave::execution_exception&)
+  catch (const octave::execution_exception& e)
     {
+      std::string stack_trace = e.info ();
+
+      if (! stack_trace.empty ())
+        std::cerr << stack_trace;
+
       octave::interpreter::recover_from_exception ();
 
       return 1;