DOKK / manpages / debian 10 / libcatalyst-perl / Catalyst::Exception::Interface.3pm.en
Catalyst::Exception::Interface(3pm) User Contributed Perl Documentation Catalyst::Exception::Interface(3pm)

Catalyst::Exception::Interface - Role defining the interface for Catalyst exceptions

   package My::Catalyst::Like::Exception;
   use Moose;
   use namespace::clean -except => 'meta';
   with 'Catalyst::Exception::Interface';
   # This comprises the required interface.
   sub as_string { 'the exception text for stringification' }
   sub throw { shift; die @_ }
   sub rethrow { shift; die @_ }

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 MooseX::Role::WithOverloading.

Provided by Moose

Catalyst Contributors, see Catalyst.pm

This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.

2019-01-19 perl v5.28.1