From: gfx Date: Wed, 19 Aug 2009 03:44:30 +0000 (+0900) Subject: Make moose_throw_error more robust X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9cce57de2e00c572587d9e5bcf7f38dfc406b9ea;p=gitmo%2FMoose.git Make moose_throw_error more robust --- diff --git a/Moose.xs b/Moose.xs index 4020580..6db0b4e 100644 --- a/Moose.xs +++ b/Moose.xs @@ -86,6 +86,9 @@ moose_throw_error(SV* const klass, SV* const data, const char* const fmt, ...){ va_list args; SV* message; + assert(klass); + assert(fmt); + va_start(args, fmt); message = vnewSVpvf(fmt, &args); va_end(args); @@ -105,6 +108,7 @@ moose_throw_error(SV* const klass, SV* const data, const char* const fmt, ...){ } PUTBACK; call_method("throw_error", G_VOID); + croak("throw_error() did not throw the error (%"SVf")", message); } }