API/Exception.pm untested

filter: Statementstmt 0.0% 0 / 27 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 9 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 41 CC 1 SCAR 6.9
CC
1
Cov
0%
new
2.0
method
2.0
params
2.0
CRAP 2.0
1 #########################################################################
2 # ex: set ts=8 sw=4 et
3 #########################################################################
4 package WWW::Facebook::API::Exception;
5  
6 use warnings;
7 use strict;
8 use Carp;
9  
10 use overload ('""' => 'stringify');
11  
12 sub new {
13 my ($class, $method, $params, $response) = @_;
14  
15 my $self = {
16 _method => $method,
17 _params => $params,
18 _response => $response
19 };
20 $self = bless $self, $class;
21 }
22  
23 sub method { my $self = shift; return $self->{_method} }
24 sub params { my $self = shift; return $self->{_params} }
25 sub response { my $self = shift; return $self->{_response} }
26  
27 sub stringify {
28 my $self = shift;
29  
30 my $method = $self->method;
31 my $params = $self->params;
32 my $response = $self->response;
33  
34 return "Error during REST $method call:"
35 . WWW::Facebook::API->log_string( $params, $response );
36 }
37  
38  
39 1; # Magic true value required at end of module
40 __END__