| 1 | package Skilletor::Error; | ||||||||||
| 2 | # ABSTRACT: Exception base class of Skilletor | ||||||||||
| 3 | |||||||||||
| 4 | 248 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 248 | ▶ | use Carp qw( croak ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | use overload | ||||||||||
| 7 | 0 | ▶ | '""' => sub { $_[0]->message }, | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.6
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 8 | 0 | ▶ | 'bool' => sub { 1 }, | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 9 | 248 | fallback => 1; | |||||||||
| 10 | 248 | ▶ | use namespace::clean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 248 | our $VERSION = '0.001'; | |||||||||
| 13 | |||||||||||
| 14 | 248 | has message => ( | |||||||||
| 15 | is => 'ro', | ||||||||||
| 16 | required => 1, | ||||||||||
| 17 | ); | ||||||||||
| 18 | |||||||||||
| 19 | 4319 | ▶ | sub throw { | ||||||||
|
Subroutine
throw: called CC=2 SCAR=7.2
Pod
documented
| |||||||||||
| 20 | 4319 | my ( $class, @args ) = @_; | |||||||||
| 21 | 4319 | ▶ | croak( $class->new( @args == 1 ? ( message => $args[0] ) : @args ) ); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | 248 | 1; | |||||||||
| 25 | |||||||||||
| 26 | __END__ | ||||||||||