changeset 6640:379244420c72

[project @ 2007-05-21 19:50:45 by jwe]
author jwe
date Mon, 21 May 2007 19:50:45 +0000
parents ed74670db09b
children 27ec13d8499b
files src/ChangeLog src/error.cc
diffstat 2 files changed, 19 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Mon May 21 19:47:22 2007 +0000
+++ b/src/ChangeLog	Mon May 21 19:50:45 2007 +0000
@@ -1,3 +1,9 @@
+2007-05-21  David Bateman  <dbateman@free.fr>
+
+	* error.cc (rethrow_error): Use NULL name so that "error:" is not
+	added to the message
+	(Frethrow): Correctly treat empty stack.
+
 2007-05-21  John W. Eaton  <jwe@octave.org>
 
 	* oct-map.h (Octave_map::numel): Return number of array elements,
--- a/src/error.cc	Mon May 21 19:47:22 2007 +0000
+++ b/src/error.cc	Mon May 21 19:50:45 2007 +0000
@@ -727,7 +727,7 @@
 {
   va_list args;
   va_start (args, fmt);
-  error_1 (std::cerr, "error", id, fmt, args);
+  error_1 (std::cerr, 0, id, fmt, args);
   va_end (args);
 }
 
@@ -858,17 +858,20 @@
 		{
 		  Octave_map err_stack = err.contents("stack")(0).map_value ();
 
-		  if (err_stack.contains ("file"))
-		    file = err_stack.contents("file")(0).string_value ();
-
-		  if (err_stack.contains ("name"))
-		    nm = err_stack.contents("name")(0).string_value ();
+		  if (err_stack.numel () > 0)
+		    {
+		      if (err_stack.contains ("file"))
+			file = err_stack.contents("file")(0).string_value ();
 
-		  if (err_stack.contains ("line"))
-		    l = err_stack.contents("line")(0).nint_value ();
+		      if (err_stack.contains ("name"))
+			nm = err_stack.contents("name")(0).string_value ();
 
-		  if (err_stack.contains ("column"))
-		    c = err_stack.contents("column")(0).nint_value ();
+		      if (err_stack.contains ("line"))
+			l = err_stack.contents("line")(0).nint_value ();
+
+		      if (err_stack.contains ("column"))
+			c = err_stack.contents("column")(0).nint_value ();
+		    }
 		}
 
 	      // Ugh.