[svn:parrot] r40479 - trunk/src/ops

NotFound at svn.parrot.org NotFound at svn.parrot.org
Mon Aug 10 20:20:54 UTC 2009


Author: NotFound
Date: Mon Aug 10 20:20:51 2009
New Revision: 40479
URL: https://trac.parrot.org/parrot/changeset/40479

Log:
[cage] throws a more descriptive exception whrn trying to throw something not accepted as a valid exception, treed++

Modified:
   trunk/src/ops/core.ops

Modified: trunk/src/ops/core.ops
==============================================================================
--- trunk/src/ops/core.ops	Mon Aug 10 13:19:25 2009	(r40478)
+++ trunk/src/ops/core.ops	Mon Aug 10 20:20:51 2009	(r40479)
@@ -800,7 +800,9 @@
     opcode_t *const ret    = expr NEXT();
     PMC            *resume = new_ret_continuation_pmc(interp, ret);
     if (PMC_IS_NULL(except) || except->vtable->base_type != enum_class_Exception)
-        except = Parrot_ex_build_exception(interp, EXCEPT_fatal, 1, NULL);
+        except = Parrot_ex_build_exception(interp, EXCEPT_fatal,
+                EXCEPTION_UNIMPLEMENTED,
+                Parrot_str_new_constant(interp, "Not a throwable object"));
     /*
      * We might return here after handling the exception, so mark the
      * current context appropriately.
@@ -815,7 +817,9 @@
     opcode_t * dest;
     PMC * except = $1;
     if (PMC_IS_NULL(except) || except->vtable->base_type != enum_class_Exception)
-        except = Parrot_ex_build_exception(interp, EXCEPT_fatal, 1, NULL);
+        except = Parrot_ex_build_exception(interp, EXCEPT_fatal,
+                EXCEPTION_UNIMPLEMENTED,
+                Parrot_str_new_constant(interp, "Not a throwable object"));
     dest = Parrot_ex_throw_from_op(interp, $1,
                                 VTABLE_get_pointer(interp, $2));
     goto ADDRESS(dest);
@@ -825,7 +829,9 @@
     opcode_t * dest;
     if (PMC_IS_NULL($1) || $1->vtable->base_type != enum_class_Exception) {
         opcode_t * const ret = expr NEXT();
-        PMC * except = Parrot_ex_build_exception(interp, EXCEPT_fatal, 1, NULL);
+        PMC * except = Parrot_ex_build_exception(interp, EXCEPT_fatal,
+                EXCEPTION_UNIMPLEMENTED,
+                Parrot_str_new_constant(interp, "Not a throwable object"));
         dest = Parrot_ex_throw_from_op(interp, except, ret);
         goto ADDRESS(dest);
     }


More information about the parrot-commits mailing list