| 1 | package Myriad::Exception; | ||||||||||
| 2 | |||||||||||
| 3 | 24 | ▶ | use Myriad::Class type => 'role'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 24 | our $VERSION = '1.001'; # VERSION | |||||||||
| 6 | 24 | our $AUTHORITY = 'cpan:DERIV'; # AUTHORITY | |||||||||
| 7 | |||||||||||
| 8 | =encoding utf8 | ||||||||||
| 9 | |||||||||||
| 10 | =head1 NAME | ||||||||||
| 11 | |||||||||||
| 12 | Myriad::Exception - standard exception rôle for all L<Myriad> code | ||||||||||
| 13 | |||||||||||
| 14 | =head1 DESCRIPTION | ||||||||||
| 15 | |||||||||||
| 16 | This is a rôle used for all exceptions throughout the framework. | ||||||||||
| 17 | |||||||||||
| 18 | =cut | ||||||||||
| 19 | |||||||||||
| 20 | 24 | method category; | |||||||||
| 21 | 24 | method message; | |||||||||
| 22 | |||||||||||
| 23 | =head2 throw | ||||||||||
| 24 | |||||||||||
| 25 | Instantiates a new exception and throws it (by calling L<perlfunc/die>). | ||||||||||
| 26 | |||||||||||
| 27 | =cut | ||||||||||
| 28 | |||||||||||
| 29 | 0 | ▶ | sub throw ($class, @args) { | ||||||||
|
Subroutine
throw: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 30 | 0 | ▶ | my $self = blessed($class) ? $class : $class->new(@args); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | 0 | die $self; | |||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | 24 | 1; | |||||||||
| 35 | |||||||||||
| 36 | =head1 AUTHOR | ||||||||||
| 37 | |||||||||||
| 38 | Deriv Group Services Ltd. C<< DERIV@cpan.org >>. | ||||||||||
| 39 | |||||||||||
| 40 | See L<Myriad/CONTRIBUTORS> for full details. | ||||||||||
| 41 | |||||||||||
| 42 | =head1 LICENSE | ||||||||||
| 43 | |||||||||||
| 44 | Copyright Deriv Group Services Ltd 2020-2022. Licensed under the same terms as Perl itself. | ||||||||||
| 45 | |||||||||||