Mercurial > jwe > octave
changeset 27824:a2a5b75efdcf
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.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 13 Dec 2019 18:18:09 -0500 |
parents | fa0582694fda |
children | 21e198a1f4a9 |
files | libinterp/corefcn/graphics.cc |
diffstat | 1 files changed, 5 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- 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.