« lib/BioX/Workflow/Command/run/Rules/Directives/Interpolate/Text.pm
↑ Summary
lib/BioX/Workflow/Command/run/Rules/Directives/Interpolate/Mustache.pm »
| 1 | package BioX::Workflow::Command::Exceptions; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use namespace::autoclean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 1 | has 'message' => ( | |||||||||
| 7 | is => 'rw', | ||||||||||
| 8 | isa => 'Str', | ||||||||||
| 9 | required => 0, | ||||||||||
| 10 | documentation => 'This is a general message for the type of error thrown.', | ||||||||||
| 11 | predicate => 'has_message', | ||||||||||
| 12 | ); | ||||||||||
| 13 | |||||||||||
| 14 | 1 | has 'info' => ( | |||||||||
| 15 | is => 'rw', | ||||||||||
| 16 | isa => 'Str', | ||||||||||
| 17 | required => 0, | ||||||||||
| 18 | documentation => 'Information specific to the error thrown', | ||||||||||
| 19 | predicate => 'has_info', | ||||||||||
| 20 | ); | ||||||||||
| 21 | |||||||||||
| 22 | 0 | ▶ | sub warn { | ||||||||
|
Subroutine
warn: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||
| 23 | 0 | my $self = shift; | |||||||||
| 24 | 0 | my $logger = shift; | |||||||||
| 25 | |||||||||||
| 26 | 0 | ▶ | if ($logger) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 27 | 0 | ▶ | $logger->warn( $self->message ) if $self->has_message; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 28 | 0 | ▶ | $logger->warn( $self->info ) if $self->has_info; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | } | ||||||||||
| 30 | else { | ||||||||||
| 31 | 0 | ▶ | Core::warn $self->message if $self->has_message; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | 0 | ▶ | Core::warn $self->info if $self->has_info; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 33 | } | ||||||||||
| 34 | } | ||||||||||
| 35 | |||||||||||
| 36 | 0 | ▶ | sub fatal { | ||||||||
|
Subroutine
fatal: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||
| 37 | 0 | my $self = shift; | |||||||||
| 38 | 0 | my $logger = shift; | |||||||||
| 39 | |||||||||||
| 40 | 0 | ▶ | if ($logger) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 41 | 0 | ▶ | $logger->fatal( $self->message ) if $self->has_message; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 42 | 0 | ▶ | $logger->fatal( $self->info ) if $self->has_info; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 43 | } | ||||||||||
| 44 | else { | ||||||||||
| 45 | 0 | ▶ | Core::warn $self->message if $self->has_message; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 46 | 0 | ▶ | Core::warn $self->info if $self->has_info; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 47 | } | ||||||||||
| 48 | |||||||||||
| 49 | 0 | exit 1; | |||||||||
| 50 | } | ||||||||||
| 51 | |||||||||||
| 52 | 1 | __PACKAGE__->meta->make_immutable; | |||||||||
| 53 | |||||||||||
| 54 | 1 | 1; | |||||||||