do not require MXRWO if Moose is new enough to have cored it
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Exception / Basic.pm
index f32a6e6..253b6a8 100644 (file)
@@ -1,6 +1,8 @@
 package Catalyst::Exception::Basic;
 
-use MooseX::Role::WithOverloading;
+use Moose::Role;
+use if !eval { require Moose; Moose->VERSION('2.1300') },
+    'MooseX::Role::WithOverloading';
 use Carp;
 use namespace::clean -except => 'meta';
 
@@ -53,11 +55,11 @@ Catalyst::Exception::Basic - Basic Catalyst Exception Role
    package My::Exception;
    use Moose;
    use namespace::clean -except => 'meta';
-   
+
    with 'Catalyst::Exception::Basic';
-   
+
    # Elsewhere..
-   My::Exception::Basic->throw( qq/Fatal exception/ );
+   My::Exception->throw( qq/Fatal exception/ );
 
 See also L<Catalyst> and L<Catalyst::Exception>.
 
@@ -76,7 +78,7 @@ Holds the exception message.
 
 =head2 as_string
 
-Stringifies the exception's message attribute. 
+Stringifies the exception's message attribute.
 Called when the object is stringified by overloading.
 
 =head2 throw( $message )