From: Fuji, Goro Date: Fri, 24 Sep 2010 02:49:20 +0000 (+0900) Subject: Make mouse_throw_error in XS more robust X-Git-Tag: 0.71~15 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=dcce2592fe68fba003835495db169f6f9ee2646a;p=gitmo%2FMouse.git Make mouse_throw_error in XS more robust --- diff --git a/xs-src/MouseUtil.xs b/xs-src/MouseUtil.xs index 2d557a6..8d0c51a 100644 --- a/xs-src/MouseUtil.xs +++ b/xs-src/MouseUtil.xs @@ -112,10 +112,13 @@ mouse_throw_error(SV* const metaobject, SV* const data /* not used */, const cha mPUSHs(newSVpvs("depth")); mPUSHi(-1); } - PUTBACK; - - call_method("throw_error", G_VOID); + if(SvOK(metaobject)) { + call_method("throw_error", G_VOID); + } + else { + call_pv("Mouse::Util::throw_error", G_VOID); + } croak("throw_error() did not throw the error (%"SVf")", message); } }