File Coverage

blib/lib/Parse/StackTrace/Type/Python/Thread.pm
Criterion Covered Total %
statement 1 3 33.3
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 2 4 50.0


line stmt bran cond sub pod time code
1             package Parse::StackTrace::Type::Python::Thread;
2 1     1   1438 use Moose;
  0            
  0            
3              
4             extends 'Parse::StackTrace::Thread';
5              
6             sub add_frame {
7             my $self = shift;
8             $self->_unshift_frame(@_);
9             my $count = 0;
10             foreach my $frame (@{ $self->frames }) {
11             $frame->{number} = $count;
12             $count++;
13             }
14             }
15              
16             sub frame_number {
17             return $_[0]->frames->[$_[1]];
18             }
19              
20             sub frame_with_crash { return $_[0]->frame_number(0) };
21              
22             __PACKAGE__->meta->make_immutable;
23              
24             1;
25              
26             __END__
27              
28             =head1 NAME
29              
30             Parse::StackTrace::Type::Python::Thread - A thread from a Python stack
31             trace.
32              
33             =head1 DESCRIPTION
34              
35             This is an implementation of L<Parse::StackTrace::Thread> for Python.
36              
37             If the parsed stack trace has a line describing the exception that was
38             thrown (like "Error: timed out"), then the C<description> of this
39             thread will contain that entire line.