changeset 21858:25b117822bfd

Set last error state when error occurs in a callback (bug #48175) * graphics.cc (gh_manager::do_execute_callback): Set the global error state to the diagnostic message shown instead of restoring the previous error, fix up to cset 0331d3e832e3.
author Mike Miller <mtmiller@octave.org>
date Fri, 10 Jun 2016 18:36:05 -0700
parents 0331d3e832e3
children ec3adcec1337
files libinterp/corefcn/graphics.cc
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/graphics.cc	Thu Jun 09 10:57:22 2016 -0700
+++ b/libinterp/corefcn/graphics.cc	Fri Jun 10 18:36:05 2016 -0700
@@ -9516,9 +9516,6 @@
           xset_gcbo (h);
         }
 
-      // Get a copy of the global last error so it can be restored.
-      octave_value_list result = feval ("lasterror", ovl (), 1);
-
       // Copy CB because "function_value" method is non-const.
 
       octave_value cb = cb_arg;
@@ -9538,7 +9535,8 @@
             {
               std::cerr << "execution error in graphics callback function"
                         << std::endl;
-              feval ("lasterror", result);
+              feval ("lasterr",
+                     ovl ("execution error in graphics callback function"));
               recover_from_exception ();
             }
         }
@@ -9570,7 +9568,8 @@
           {
             std::cerr << "execution error in graphics callback function"
                       << std::endl;
-            feval ("lasterror", result);
+            feval ("lasterr",
+                   ovl ("execution error in graphics callback function"));
             recover_from_exception ();
           }