do not require MXRWO if Moose is new enough to have cored it
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Exception / Interface.pm
index 65d5a54..73e4cc0 100644 (file)
@@ -1,6 +1,8 @@
 package Catalyst::Exception::Interface;
 
-use MooseX::Role::WithOverloading;
+use Moose::Role;
+use if !eval { require Moose; Moose->VERSION('2.1300') },
+    'MooseX::Role::WithOverloading';
 use namespace::clean -except => 'meta';
 
 use overload
@@ -15,22 +17,20 @@ __END__
 
 =head1 NAME
 
-Catalyst::Exception::Interface - Exception for redispatching using $ctx->detach()
+Catalyst::Exception::Interface - Role defining the interface for Catalyst exceptions
 
 =head1 SYNOPSIS
 
    package My::Catalyst::Like::Exception;
    use Moose;
    use namespace::clean -except => 'meta';
-   
-   # This comprises the required interface.
-   sub as_string { 'the exception text for stringification' }
-   sub die { shift; die @_ }
-   sub die { shift; die @_ }
-   
+
    with 'Catalyst::Exception::Interface';
 
-See also L<Catalyst> and L<Catalyst::Exception>.
+   # This comprises the required interface.
+   sub as_string { 'the exception text for stringification' }
+   sub throw { shift; die @_ }
+   sub rethrow { shift; die @_ }
 
 =head1 DESCRIPTION
 
@@ -57,6 +57,16 @@ must use L<MooseX::Role::WithOverloading>.
 
 Provided by Moose
 
+=head1 SEE ALSO
+
+=over 4
+
+=item L<Catalyst>
+
+=item L<Catalyst::Exception>
+
+=back
+
 =head1 AUTHORS
 
 Catalyst Contributors, see Catalyst.pm