File Coverage

blib/lib/Business/CyberSource/Exception/Response.pm
Criterion Covered Total %
statement 20 20 100.0
branch n/a
condition n/a
subroutine 7 7 100.0
pod n/a
total 27 27 100.0


line stmt bran cond sub pod time code
1             package Business::CyberSource::Exception::Response;
2 1     1   450 use strict;
  1         2  
  1         23  
3 1     1   3 use warnings;
  1         1  
  1         17  
4 1     1   4 use namespace::autoclean;
  1         0  
  1         5  
5              
6             our $VERSION = '0.010007'; # VERSION
7              
8 1     1   60 use Moose;
  1         2  
  1         6  
9 1     1   4260 use namespace::autoclean;
  1         1  
  1         4  
10 1     1   425 use MooseX::Aliases;
  1         779  
  1         3  
11             extends 'Business::CyberSource::Exception';
12             with 'Business::CyberSource::Response::Role::Base',
13             'Business::CyberSource::Role::Traceable' => {
14             -excludes => [qw( trace )]
15             };
16              
17             sub _build_message {
18 1     1   127 my $self = shift;
19 1         32 return $self->decision . ' ' . $self->reason_text;
20             }
21              
22             has '+value' => (
23             default => sub { return $_[0]->reason_code },
24             );
25              
26             __PACKAGE__->meta->make_immutable;
27             1;
28             # ABSTRACT: response thrown as an object because of ERROR state
29              
30             __END__
31              
32             =pod
33              
34             =encoding UTF-8
35              
36             =head1 NAME
37              
38             Business::CyberSource::Exception::Response - response thrown as an object because of ERROR state
39              
40             =head1 VERSION
41              
42             version 0.010007
43              
44             =head1 SYNOPSIS
45              
46             use Try::Tiny;
47             use Safe::Isa;
48              
49             try { ... }
50             catch {
51             if ( $_->$_does('Business::CyberSource::Response::Role::Base) )
52             # log reason_text
53             }
54             };
55              
56             =head1 DESCRIPTION
57              
58             do not catch this object, should Moose provide an exception role at some
59             point, we will remove this class in favor of applying the role to
60             L<Business::CyberSource::Response> instead catch
61             L<Business::CyberSource::Response::Role::Base>
62              
63             =head1 BUGS
64              
65             Please report any bugs or feature requests on the bugtracker website
66             https://github.com/xenoterracide/business-cybersource/issues
67              
68             When submitting a bug or request, please include a test-file or a
69             patch to an existing test-file that illustrates the bug or desired
70             feature.
71              
72             =head1 AUTHOR
73              
74             Caleb Cushing <xenoterracide@gmail.com>
75              
76             =head1 COPYRIGHT AND LICENSE
77              
78             This software is Copyright (c) 2016 by Caleb Cushing <xenoterracide@gmail.com>.
79              
80             This is free software, licensed under:
81              
82             The Artistic License 2.0 (GPL Compatible)
83              
84             =cut