diff libinterp/corefcn/oct-handle.h @ 20577:c547458dc10e

eliminate error_state from most header files * defun-int.h, event-queue.h, graphics.in.h, oct-handle.h, ov-classdef.h, misc/f77-fcn.h, unwind-prot.h: Eliminate use of global error_state variable.
author John W. Eaton <jwe@octave.org>
date Sat, 03 Oct 2015 13:20:28 -0400
parents 4197fc428c7d
children
line wrap: on
line diff
--- a/libinterp/corefcn/oct-handle.h	Fri Oct 02 16:07:41 2015 -0400
+++ b/libinterp/corefcn/oct-handle.h	Sat Oct 03 13:20:28 2015 -0400
@@ -42,12 +42,14 @@
       /* do nothing */;
     else
       {
-        double tval = a.double_value ();
-
-        if (! error_state)
-          val = tval;
-        else
-          error ("invalid handle");
+        try
+          {
+            val = a.double_value ();
+          }
+        catch (const octave_execution_exception&)
+          {
+            error ("invalid handle");
+          }
       }
   }