diff --git a/libinterp/corefcn/graphics.cc b/libinterp/corefcn/graphics.cc
--- a/libinterp/corefcn/graphics.cc
+++ b/libinterp/corefcn/graphics.cc
@@ -9527,7 +9527,14 @@ gh_manager::do_execute_callback (const g
           int status;
           std::string s = cb.string_value ();
 
-          eval_string (s, false, status, 0);
+          try
+            {
+              eval_string (s, false, status, 0);
+            }
+          catch (octave_execution_exception&)
+            {
+              recover_from_exception ();
+            }
         }
       else if (cb.is_cell () && cb.length () > 0
                && (cb.rows () == 1 || cb.columns () == 1)
@@ -9549,7 +9556,14 @@ gh_manager::do_execute_callback (const g
         }
 
       if (fcn)
-        feval (fcn, args);
+        try
+          {
+            feval (fcn, args);
+          }
+        catch (octave_execution_exception&)
+          {
+            recover_from_exception ();
+          }
 
       if (Vdrawnow_requested)
         {
