File Coverage

lib/Mojo/IOLoop/ReadWriteProcess/Exception.pm
Criterion Covered Total %
statement 8 8 100.0
branch 2 2 100.0
condition 1 3 33.3
subroutine 3 3 100.0
pod 2 2 100.0
total 16 18 88.8


line stmt bran cond sub pod time code
1             package Mojo::IOLoop::ReadWriteProcess::Exception;
2 38     38   273 use Mojo::Base -base;
  38         91  
  38         257  
3              
4             sub new {
5 85     85 1 327 my $class = shift;
6 85 100       750 my $value = @_ == 1 ? $_[0] : "";
7 85   33     1685 return bless \$value, ref $class || $class;
8             }
9              
10 14     14 1 2104 sub to_string { "${$_[0]}" }
  14         293  
11              
12             1;
13              
14             =encoding utf-8
15              
16             =head1 NAME
17              
18             Mojo::IOLoop::ReadWriteProcess::Exception - Exception object for Mojo::IOLoop::ReadWriteProcess.
19              
20             =head1 SYNOPSIS
21              
22             use Mojo::IOLoop::ReadWriteProcess::Exception;
23              
24             my $e = Mojo::IOLoop::ReadWriteProcess::Exception->new("Errored!");
25              
26             print "Error $e";
27              
28             my $string_error = $e->to_string;
29              
30             =head1 METHODS
31              
32             L inherits all methods from L and implements
33             the following new ones.
34              
35             =head2 to_string
36              
37             my $e = Mojo::IOLoop::ReadWriteProcess::Exception->new("Errored!");
38             my $string_error = $e->to_string;
39              
40             Returns stringified version of the error message.
41              
42             =head1 LICENSE
43              
44             Copyright (C) Ettore Di Giacinto.
45              
46             This library is free software; you can redistribute it and/or modify
47             it under the same terms as Perl itself.
48              
49             =head1 AUTHOR
50              
51             Ettore Di Giacinto Eedigiacinto@suse.comE
52              
53             =cut