Conveyor/Exception/Handler.pm

filter: Statementstmt 65.5% 19 / 29 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 58.3% 7 / 12 Podpod 100% 5 / 5 totaltotal 67.3% 31 / 46 CC 1 SCAR 3.5
CC
1
Cov
66%
RC_FOR_EXCEPTION_CLASS_HASH
2.0
STATUS_FOR_EXCEPTION_CLASS_HASH
2.0
errcode_for_exception_class
2.0
CRAP 1.4
« Conveyor/App/Test/Stage/TxSelector.pm ↑ Summary Conveyor/Ticket/Facets.pm »
1 1 ▶use 5.008;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 package Data::Conveyor::Exception::Handler;
6 1 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 $Data::Conveyor::Exception::Handler::VERSION = '1.103130';
8 }
9  
10 # ABSTRACT: Stage-based conveyor-belt-like ticket handling system
11 1 ▶use Data::Miscellany 'class_map';
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use parent 'Class::Scaffold::Storable';
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 ▶use constant ERRCODE_FOR_EXCEPTION_CLASS_HASH => (
Subroutine BEGIN: called CC=1 SCAR=0.0
14 UNIVERSAL => 'NC20000', # fallback
15 1 );
16  
17 0 ▶sub RC_FOR_EXCEPTION_CLASS_HASH {
Subroutine RC_FOR_EXCEPTION_CLASS_HASH: not called CC=1 SCAR=6.9
Pod documented
18 0 local $_ = $_[0]->delegate;
19 0 ( UNIVERSAL => $_->RC_INTERNAL_ERROR, # fallback
20 'Error::Hierarchy::Internal' => $_->RC_INTERNAL_ERROR,
21 'Class::Value::Exception' => $_->RC_ERROR,
22 'Class::Scaffold::Exception::Business' => $_->RC_ERROR,
23 'Data::Conveyor::Exception::Ticket' => $_->RC_INTERNAL_ERROR,
24 'Data::Conveyor::Exception::Ticket::MissingLock' => $_->RC_ERROR,
25 );
26 }
27  
28 0 ▶sub STATUS_FOR_EXCEPTION_CLASS_HASH {
Subroutine STATUS_FOR_EXCEPTION_CLASS_HASH: not called CC=1 SCAR=6.9
Pod documented
29 0 local $_ = $_[0]->delegate;
30 0 ( UNIVERSAL => $_->TS_ERROR, # fallback
31 'Error::Hierarchy::Internal' => $_->TS_ERROR,
32 'Class::Value::Exception' => $_->TS_RUNNING,
33 'Class::Scaffold::Exception::Business' => $_->TS_RUNNING,
34 'Data::Conveyor::Exception::Ticket' => $_->TS_ERROR,
35 'Data::Conveyor::Exception::Ticket::MissingLock' => $_->TS_RUNNING,
36 );
37 }
38  
39 0 ▶sub errcode_for_exception_class {
Subroutine errcode_for_exception_class: not called CC=1 SCAR=6.9
Pod documented
40 0 my ($self, $class) = @_;
41 0 class_map(
42 $class,
43 scalar $self->every_hash(
44 'ERRCODE_FOR_EXCEPTION_CLASS_HASH',
45 'exception.errcode_for_class',
46 )
47 );
48 }
49  
50 0 ▶sub rc_for_exception_class {
Subroutine rc_for_exception_class: not called CC=1 SCAR=6.9
Pod documented
51 0 my ($self, $exception) = @_;
52  
53 # Here we don't use the payload item, but a subclass might use it to
54 # change the rc depending on the object type and command found in the
55 # payload item.
56 0 $self->delegate->make_obj(
57 'value_ticket_rc',
58 class_map(
59 $exception,
60 scalar $self->every_hash(
61 'RC_FOR_EXCEPTION_CLASS_HASH', 'exception.rc_for_class',
62 )
63 )
64 );
65 }
66  
67 0 ▶sub status_for_exception_class {
Subroutine status_for_exception_class: not called CC=1 SCAR=6.9
Pod documented
68 0 my ($self, $exception) = @_;
69  
70 # Here we don't use the payload item, but a subclass might use it to
71 # change the status depending on the object type and command found in the
72 # payload item.
73 0 $self->delegate->make_obj(
74 'value_ticket_status',
75 class_map(
76 $exception,
77 scalar $self->every_hash(
78 'STATUS_FOR_EXCEPTION_CLASS_HASH',
79 'exception.status_for_class',
80 )
81 )
82 );
83 }
84 1 1;
85  
86  
87 __END__
« Conveyor/App/Test/Stage/TxSelector.pm ↑ Summary Conveyor/Ticket/Facets.pm »