[Moose-commits] r7594 - Mouse/trunk/lib/Mouse/Meta
sartak at code2.0beta.co.uk
sartak at code2.0beta.co.uk
Tue Feb 10 01:23:39 GMT 2009
Author: sartak
Date: 2009-02-09 17:23:39 -0800 (Mon, 09 Feb 2009)
New Revision: 7594
Modified:
Mouse/trunk/lib/Mouse/Meta/Class.pm
Log:
Throw a better error message when using a method modifier without CMM
Modified: Mouse/trunk/lib/Mouse/Meta/Class.pm
===================================================================
--- Mouse/trunk/lib/Mouse/Meta/Class.pm 2009-02-10 01:23:33 UTC (rev 7593)
+++ Mouse/trunk/lib/Mouse/Meta/Class.pm 2009-02-10 01:23:39 UTC (rev 7594)
@@ -195,8 +195,7 @@
$code
);
}
- else {
- require Class::Method::Modifiers;
+ elsif (eval "require Class::Method::Modifiers; 1") {
Class::Method::Modifiers::_install_modifier(
$into,
$type,
@@ -204,6 +203,9 @@
$code
);
}
+ else {
+ Carp::croak("Method modifiers require the use of Class::Method::Modifiers. Please install it from CPAN and file a bug report with this application.");
+ }
}
sub add_before_method_modifier {
More information about the Moose-commits
mailing list