File Coverage

blib/lib/Hoppy/TCPHandler/Error.pm
Criterion Covered Total %
statement 18 19 94.7
branch 2 4 50.0
condition n/a
subroutine 4 4 100.0
pod 1 1 100.0
total 25 28 89.2


line stmt bran cond sub pod time code
1             package Hoppy::TCPHandler::Error;
2 7     7   37 use strict;
  7         11  
  7         210  
3 7     7   32 use warnings;
  7         14  
  7         171  
4 7     7   31 use base qw( Hoppy::Base );
  7         12  
  7         1202  
5              
6             sub do_handle {
7 1     1 1 14 my $self = shift;
8 1         3 my $poe = shift;
9 1         14 my $c = $self->context;
10 1         26 my $session_id = $poe->session->ID;
11 1         12 my $user = $c->room->fetch_user_from_session_id($session_id);
12 1         2 my $user_id;
13 1 50       15 if ($user) {
14 1         6 $user_id = $user->user_id;
15             }
16 1 50       12 if ( my $hook = $c->hook->{client_error} ) {
17 0           $hook->work( { poe => $poe, user_id => $user_id } );
18             }
19             }
20              
21             1;
22             __END__