# HG changeset patch # User John W. Eaton # Date 1576279089 18000 # Node ID a2a5b75efdcfe9203f64779b6d57f70747dcf4d6 # Parent fa0582694fda4da4c2112454a54a9c05f580fe8a use interpreter::handle_exception to display errors in graphics callbacks * graphics.cc (gh_manager::execute_callback): Call m_interpreter.handle_exception to display error message, set last_error info, and recover from exception. diff -r fa0582694fda -r a2a5b75efdcf libinterp/corefcn/graphics.cc --- a/libinterp/corefcn/graphics.cc Fri Dec 13 21:33:28 2019 +0100 +++ b/libinterp/corefcn/graphics.cc Fri Dec 13 18:18:09 2019 -0500 @@ -12144,15 +12144,9 @@ { m_interpreter.eval_string (s, false, status, 0); } - catch (octave::execution_exception&) - { - std::cerr << "execution error in graphics callback function" - << std::endl; - - es.last_error_id (""); - es.last_error_message ("execution error in graphics callback function"); - - m_interpreter.recover_from_exception (); + catch (octave::execution_exception& e) + { + m_interpreter.handle_exception (e); } } else if (cb.iscell () && cb.length () > 0 @@ -12182,15 +12176,9 @@ else octave::feval (fcn, args); } - catch (octave::execution_exception&) + catch (octave::execution_exception& e) { - std::cerr << "execution error in graphics callback function" - << std::endl; - - es.last_error_id (""); - es.last_error_message ("execution error in graphics callback function"); - - m_interpreter.recover_from_exception (); + m_interpreter.handle_exception (e); } // Redraw after interacting with a user-interface (ui*) object.