changeset 22159:63c806042c27

convert errors in onCleanup destructor to warnings (bug #48574)
author John W. Eaton <jwe@octave.org>
date Fri, 22 Jul 2016 12:08:51 -0400
parents 623b556e9d45
children 766f934db568
files libinterp/octave-value/ov-oncleanup.cc
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/octave-value/ov-oncleanup.cc	Fri Jul 22 10:28:51 2016 -0400
+++ b/libinterp/octave-value/ov-oncleanup.cc	Fri Jul 22 12:08:51 2016 -0400
@@ -76,6 +76,8 @@
   frame.protect_var (quit_allowed);
   quit_allowed = false;
 
+  interpreter_try (frame);
+
   try
     {
       // Run the actual code.
@@ -89,12 +91,15 @@
     }
   catch (const octave_execution_exception&)
     {
-      throw;
+      std::string msg = last_error_message ();
+      warning ("onCleanup: error caught while executing cleanup function:\n%s\n",
+               msg.c_str ());
+      
     }
   catch (...) // Yes, the black hole.  We're in a d-tor.
     {
       // This shouldn't happen, in theory.
-      error ("onCleanup: internal error: unhandled exception in cleanup action");
+      warning ("onCleanup: internal error: unhandled exception in cleanup action");
     }
 }