[Catalyst-commits] r11918 - Catalyst-Runtime/5.80/trunk/lib/Catalyst/Exception

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Thu Nov 19 21:58:59 GMT 2009


Author: t0m
Date: 2009-11-19 21:58:59 +0000 (Thu, 19 Nov 2009)
New Revision: 11918

Modified:
   Catalyst-Runtime/5.80/trunk/lib/Catalyst/Exception/Basic.pm
   Catalyst-Runtime/5.80/trunk/lib/Catalyst/Exception/Detach.pm
   Catalyst-Runtime/5.80/trunk/lib/Catalyst/Exception/Go.pm
   Catalyst-Runtime/5.80/trunk/lib/Catalyst/Exception/Interface.pm
Log:
Add Pod for all the new exception classes

Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Exception/Basic.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Exception/Basic.pm	2009-11-19 21:54:32 UTC (rev 11917)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Exception/Basic.pm	2009-11-19 21:58:59 UTC (rev 11918)
@@ -43,3 +43,65 @@
 }
 
 1;
+
+=head1 NAME
+
+Catalyst::Exception::Basic - Basic Catalyst Exception Role
+
+=head1 SYNOPSIS
+
+   package My::Exception;
+   use Moose;
+   use namespace::clean -except => 'meta';
+   
+   with 'Catalyst::Exception::Basic';
+   
+   # Elsewhere..
+   My::Exception::Basic->throw( qq/Fatal exception/ );
+
+See also L<Catalyst> and L<Catalyst::Exception>.
+
+=head1 DESCRIPTION
+
+This is the basic Catalyst Exception role which implements all of
+L<Catalyst::Exception::Interface>.
+
+=head1 ATTRIBUTES
+
+=head2 message
+
+Holds the exception message.
+
+=head1 METHODS
+
+=head2 as_string
+
+Stringifies the exception's message attribute. 
+Called when the object is stringified by overloading.
+
+=head2 throw( $message )
+
+=head2 throw( message => $message )
+
+=head2 throw( error => $error )
+
+Throws a fatal exception.
+
+=head2 rethrow( $exception )
+
+Rethrows a caught exception.
+
+=head2 meta
+
+Provided by Moose
+
+=head1 AUTHORS
+
+Catalyst Contributors, see Catalyst.pm
+
+=head1 COPYRIGHT
+
+This library is free software. You can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut

Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Exception/Detach.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Exception/Detach.pm	2009-11-19 21:54:32 UTC (rev 11917)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Exception/Detach.pm	2009-11-19 21:58:59 UTC (rev 11918)
@@ -19,4 +19,35 @@
 
 Catalyst::Exception::Detach - Exception for redispatching using $ctx->detach()
 
+=head1 SYNOPSIS
+
+   Do not use this class directly, instead you should use the singleton instance
+   found in $Catalyst::DETACH;
+   
+   E.g. die $Catalyst::DETACH
+   
+See also L<Catalyst> and L<Catalyst::Exception>.
+
+=head1 DESCRIPTION
+
+This is the class for the Catalyst Exception which is thrown then you call
+C<< $c->detach() >>. There should be a singleton instance of this class in the
+C<< $Catalyst::DETACH >> global variable.
+
+Users should never need to know or care about this exception, please just use
+C<< $c->detach >>
+
+=head2 meta
+
+Provided by Moose
+
+=head1 AUTHORS
+
+Catalyst Contributors, see Catalyst.pm
+
+=head1 COPYRIGHT
+
+This library is free software. You can redistribute it and/or modify
+it under the same terms as Perl itself.
+
 =cut

Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Exception/Go.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Exception/Go.pm	2009-11-19 21:54:32 UTC (rev 11917)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Exception/Go.pm	2009-11-19 21:58:59 UTC (rev 11918)
@@ -19,4 +19,35 @@
 
 Catalyst::Exception::Go - Exception for redispatching using $ctx->go()
 
+=head1 SYNOPSIS
+
+   Do not use this class directly, instead you should use the singleton instance
+   found in $Catalyst::GO;
+   
+   E.g. die $Catalyst::GO;
+   
+See also L<Catalyst> and L<Catalyst::Exception>.
+
+=head1 DESCRIPTION
+
+This is the class for the Catalyst Exception which is thrown then you call
+C<< $c->go() >>. There should be a singleton instance of this class in the
+C<< $Catalyst::DETACH >> global variable.
+
+Users should never need to know or care about this exception, please just use
+C<< $c->detach >>
+
+=head2 meta
+
+Provided by Moose
+
+=head1 AUTHORS
+
+Catalyst Contributors, see Catalyst.pm
+
+=head1 COPYRIGHT
+
+This library is free software. You can redistribute it and/or modify
+it under the same terms as Perl itself.
+
 =cut

Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Exception/Interface.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Exception/Interface.pm	2009-11-19 21:54:32 UTC (rev 11917)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Exception/Interface.pm	2009-11-19 21:58:59 UTC (rev 11918)
@@ -10,3 +10,60 @@
 requires qw/as_string throw rethrow/;
 
 1;
+
+__END__
+
+=head1 NAME
+
+Catalyst::Exception::Interface - Exception for redispatching using $ctx->detach()
+
+=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>.
+
+=head1 DESCRIPTION
+
+This is a role for the required interface for Catalyst exceptions.
+
+It ensures that all exceptions follow the expected interface,
+and adds overloading for stringification when composed onto a
+class.
+
+Note that if you compose this role onto another role, that role
+must use L<MooseX::Role::WithOverloading>.
+
+=head1 REQUIRED METHODS
+
+=head2 as_string
+
+=head2 throw
+
+=head2 rethrow
+
+=head1 METHODS
+
+=head2 meta
+
+Provided by Moose
+
+=head1 AUTHORS
+
+Catalyst Contributors, see Catalyst.pm
+
+=head1 COPYRIGHT
+
+This library is free software. You can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut




More information about the Catalyst-commits mailing list