« /usr/local/lib/perl5/site_perl/5.44.0/namespace/clean/_Util.pm
↑ Summary
/usr/local/lib/perl5/site_perl/5.44.0/Method/Generate/BuildAll.pm »
| 1 | package Skilletor::Error; | ||||||||||
| 2 | # ABSTRACT: Exception base class of Skilletor | ||||||||||
| 3 | |||||||||||
| 4 | 712 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 712 | ▶ | use Carp qw( croak ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 712 | ▶ | use namespace::clean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | # After namespace::clean, not before: overload keeps its table as subs in this package ("((", | ||||||||||
| 8 | # "()", "(\"\"", "(bool"), and namespace::clean removes every sub that exists when it is used. | ||||||||||
| 9 | use overload | ||||||||||
| 10 | 169 | ▶ | '""' => sub { $_[0]->message }, | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 89 | ▶ | 'bool' => sub { 1 }, | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 12 | 712 | fallback => 1; | |||||||||
| 13 | |||||||||||
| 14 | 712 | our $VERSION = '0.008000'; | |||||||||
| 15 | |||||||||||
| 16 | 712 | has message => ( | |||||||||
| 17 | is => 'ro', | ||||||||||
| 18 | required => 1, | ||||||||||
| 19 | ); | ||||||||||
| 20 | |||||||||||
| 21 | 5525 | ▶ | sub throw { | ||||||||
|
Subroutine
throw: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 22 | 5525 | my ( $class, @args ) = @_; | |||||||||
| 23 | 5525 | ▶ | croak( $class->new( @args == 1 ? ( message => $args[0] ) : @args ) ); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | } | ||||||||||
| 25 | |||||||||||
| 26 | 712 | 1; | |||||||||
| 27 | |||||||||||
| 28 | __END__ | ||||||||||