| 1 | 6 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | 6 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | # Copyright (C) 2015 Christian Garbs <mitch@cgarbs.de> | ||||||||||
| 4 | # Licensed under GNU GPL v2 or later. | ||||||||||
| 5 | |||||||||||
| 6 | package Net::Fritz::Error; | ||||||||||
| 7 | # ABSTRACT: wraps any error from the L<Net::Fritz> modules | ||||||||||
| 8 | 6 | $Net::Fritz::Error::VERSION = 'v0.0.9'; | |||||||||
| 9 | |||||||||||
| 10 | # TODO: use a global configuration option to make every call to | ||||||||||
| 11 | # Net::Fritz::Error->new an immediately fatal error? | ||||||||||
| 12 | |||||||||||
| 13 | 6 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | |||||||||||
| 15 | |||||||||||
| 16 | 6 | has error => ( is => 'ro', default => 'generic error' ); | |||||||||
| 17 | |||||||||||
| 18 | |||||||||||
| 19 | 26 | ▶ | sub BUILDARGS { | ||||||||
|
Subroutine
BUILDARGS: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 20 | 26 | my ( $class, @args ) = @_; | |||||||||
| 21 | |||||||||||
| 22 | 26 | ▶ | unshift @args, "error" if @args % 2 == 1; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | |||||||||||
| 24 | 26 | return { @args }; | |||||||||
| 25 | }; | ||||||||||
| 26 | |||||||||||
| 27 | |||||||||||
| 28 | 1 | ▶ | sub errorcheck { | ||||||||
|
Subroutine
errorcheck: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 29 | 1 | my $self = shift; | |||||||||
| 30 | 1 | die "Net::Fritz::Error: " . $self->error. "\n"; | |||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | |||||||||||
| 34 | 1 | ▶ | sub dump { | ||||||||
|
Subroutine
dump: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 35 | 1 | my $self = shift; | |||||||||
| 36 | |||||||||||
| 37 | 1 | return "Net::Fritz::Error: " . $self->error . "\n"; | |||||||||
| 38 | } | ||||||||||
| 39 | |||||||||||
| 40 | |||||||||||
| 41 | 6 | 1; | |||||||||
| 42 | |||||||||||
| 43 | __END__ | ||||||||||