# New Ticket Created by  chromatic 
# Please include the string:  [perl #27015]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=27015 >


Hi there,

This patch made it slightly easier for me to debug errors in my code. 
It may require tweaking to remove the newline, but these exceptions
print much more prettily with it.

Enjoy,
-- c


Index: classes/parrotobject.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/parrotobject.pmc,v
retrieving revision 1.17
diff -u -u -r1.17 parrotobject.pmc
--- classes/parrotobject.pmc	18 Feb 2004 01:12:53 -0000	1.17
+++ classes/parrotobject.pmc	22 Feb 2004 07:31:54 -0000
@@ -175,7 +175,8 @@
             POD_CLASS);
         INTVAL idx = VTABLE_get_integer_keyed_str(interpreter, class, attr);
         if (idx < 0)
-            internal_exception(1, "No such attribute");
+            internal_exception(1, "No such attribute: %s\n",
+				string_to_cstring( interpreter, attr ));
         return SELF.get_integer_keyed_int(idx);
     }
 
@@ -228,7 +229,8 @@
             POD_CLASS);
         INTVAL idx = VTABLE_get_integer_keyed_str(interpreter, class, attr);
         if (idx < 0)
-            internal_exception(1, "No such attribute");
+            internal_exception(1, "No such attribute: %s\n",
+				string_to_cstring( interpreter, attr ));
         SELF.set_integer_keyed_int(idx, value);
     }
 
@@ -282,7 +284,8 @@
             POD_CLASS);
         INTVAL idx = VTABLE_get_integer_keyed_str(interpreter, class, attr);
         if (idx < 0)
-            internal_exception(1, "No such attribute");
+            internal_exception(1, "No such attribute: %s\n",
+				string_to_cstring( interpreter, attr ));
         return SELF.get_number_keyed_int(idx);
     }
 
@@ -335,7 +338,8 @@
             POD_CLASS);
         INTVAL idx = VTABLE_get_integer_keyed_str(interpreter, class, attr);
         if (idx < 0)
-            internal_exception(1, "No such attribute");
+            internal_exception(1, "No such attribute: %s\n",
+				string_to_cstring( interpreter, attr ));
         SELF.set_number_keyed_int(idx, value);
     }
 
@@ -388,7 +392,8 @@
             POD_CLASS);
         INTVAL idx = VTABLE_get_integer_keyed_str(interpreter, class, attr);
         if (idx < 0)
-            internal_exception(1, "No such attribute");
+            internal_exception(1, "No such attribute: %s\n",
+				string_to_cstring( interpreter, attr ));
         return SELF.get_string_keyed_int(idx);
     }
 
@@ -441,7 +446,8 @@
             POD_CLASS);
         INTVAL idx = VTABLE_get_integer_keyed_str(interpreter, class, attr);
         if (idx < 0)
-            internal_exception(1, "No such attribute");
+            internal_exception(1, "No such attribute: %s\n",
+				string_to_cstring( interpreter, attr ));
         SELF.set_string_keyed_int(idx, value);
     }
 
@@ -494,7 +500,8 @@
             POD_CLASS);
         INTVAL idx = VTABLE_get_integer_keyed_str(interpreter, class, attr);
         if (idx < 0)
-            internal_exception(1, "No such attribute");
+            internal_exception(1, "No such attribute: %s\n",
+				string_to_cstring( interpreter, attr ));
         return SELF.get_pmc_keyed_int(idx);
     }
 
@@ -547,7 +554,8 @@
             POD_CLASS);
         INTVAL idx = VTABLE_get_integer_keyed_str(interpreter, class, attr);
         if (idx < 0)
-            internal_exception(1, "No such attribute");
+            internal_exception(1, "No such attribute: %s\n",
+				string_to_cstring( interpreter, attr ));
         SELF.set_pmc_keyed_int(idx, value);
     }
 

Reply via email to