Index: include/parrot/exceptions.h
===================================================================
--- include/parrot/exceptions.h	(revision 8062)
+++ include/parrot/exceptions.h	(working copy)
@@ -57,6 +58,7 @@
         E_AssertionError,
         E_LookupError,
           E_IndexError,
+            E_IndexOutOfBoundsError,
           E_KeyError,
         E_ArithmeticError,
           E_OverflowError,

Index: classes/array.pmc
===================================================================
--- classes/array.pmc	(revision 8062)
+++ classes/array.pmc	(working copy)
@@ -50,7 +50,8 @@
 {
     PMC *value;
     if (ret == 0)
-    internal_exception(OUT_OF_BOUNDS, "Array index out of bounds!");
+    real_exception(interp, NULL, E_IndexOutOfBoundsError,
+        "Array index out of bounds!");
     /* XXX getting non existent value, exception or undef?
      * current is for perlarray */
     if (ret == (void*) -1)
@@ -135,7 +136,8 @@
     PMC *value;
 
     if (ret == 0)
-        internal_exception(OUT_OF_BOUNDS, "Array index out of bounds!");
+        real_exception(interp, NULL, E_IndexOutOfBoundsError,
+            "Array index out of bounds!");
     /* assign into a sparse or not yet set value */
     if (ret == (void*) -1 || *(PMC**)ret == 0) {
         value = undef(interp);
@@ -675,7 +677,8 @@
         INTVAL length;
         length = ((List *) PMC_data(SELF))->length;
         if (idx >= length || -idx > length) {
-            internal_exception(OUT_OF_BOUNDS, "Array index out of bounds!");
+            real_exception(INTERP, NULL, E_IndexOutOfBoundsError,
+                "Array index out of bounds!");
         }
 
         list_assign(INTERP, (List *) PMC_data(SELF), idx,
@@ -974,7 +977,8 @@
 
     void splice(PMC* value, INTVAL offset, INTVAL count) {
         if (SELF->vtable->base_type != value->vtable->base_type)
-            internal_exception(1, "Type mismatch in splice");
+            real_exception(INTERP, NULL, E_TypeError,
+                "Type mismatch in splice");
         list_splice(INTERP, (List*) PMC_data(SELF),
             (List *) PMC_data(value), offset, count);
     }
@@ -1158,7 +1162,8 @@
                     return iter;
                 }
         }
-        internal_exception(1, "Array: Unknown slice type");
+        real_exception(INTERP, NULL, E_TypeError,
+            "Array: Unknown slice type");
         return NULL;
     }
 

Index: t/pmc/array.t
===================================================================
--- t/pmc/array.t	(revision 8062)
+++ t/pmc/array.t	(working copy)
@@ -159,9 +159,7 @@
 ok 3
 OUTPUT
 
-# TODO: Rewrite these properly when we have exceptions
-
-output_is(<<'CODE', <<'OUTPUT', "Setting out-of-bounds elements");
+output_like(<<'CODE', <<'OUTPUT', "Setting out-of-bounds elements");
         new P0, .Array
         set P0, 1
 
@@ -169,17 +167,19 @@
 
 	end
 CODE
-Array index out of bounds!
+/^Array index out of bounds!
+current instr/
 OUTPUT
 
-output_is(<<'CODE', <<'OUTPUT', "Getting out-of-bounds elements");
+output_like(<<'CODE', <<'OUTPUT', "Getting out-of-bounds elements");
         new P0, .Array
         set P0, 1
 
 	set I0, P0[1]
 	end
 CODE
-Array index out of bounds!
+/^Array index out of bounds!
+current instr/
 OUTPUT
 
 output_is(<<'CODE', <<OUTPUT, "defined");

