| File | /usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/XML/LibXML/Error.pm |
| Statements Executed | 104 |
| Statement Execution Time | 19.6ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 29µs | 105µs | XML::LibXML::Error::BEGIN@15 |
| 1 | 1 | 1 | 26µs | 31µs | XML::LibXML::Error::BEGIN@11 |
| 1 | 1 | 1 | 25µs | 72µs | XML::LibXML::Error::BEGIN@36 |
| 1 | 1 | 1 | 24µs | 92µs | XML::LibXML::Error::BEGIN@225 |
| 1 | 1 | 1 | 19µs | 65µs | XML::LibXML::Error::BEGIN@39 |
| 1 | 1 | 1 | 16µs | 86µs | XML::LibXML::Error::BEGIN@13 |
| 1 | 1 | 1 | 14µs | 61µs | XML::LibXML::Error::BEGIN@29 |
| 1 | 1 | 1 | 14µs | 84µs | XML::LibXML::Error::BEGIN@27 |
| 1 | 1 | 1 | 13µs | 88µs | XML::LibXML::Error::BEGIN@33 |
| 1 | 1 | 1 | 13µs | 61µs | XML::LibXML::Error::BEGIN@32 |
| 1 | 1 | 1 | 13µs | 61µs | XML::LibXML::Error::BEGIN@30 |
| 1 | 1 | 1 | 13µs | 61µs | XML::LibXML::Error::BEGIN@34 |
| 1 | 1 | 1 | 13µs | 59µs | XML::LibXML::Error::BEGIN@38 |
| 1 | 1 | 1 | 13µs | 60µs | XML::LibXML::Error::BEGIN@35 |
| 1 | 1 | 1 | 12µs | 60µs | XML::LibXML::Error::BEGIN@28 |
| 1 | 1 | 1 | 12µs | 59µs | XML::LibXML::Error::BEGIN@37 |
| 1 | 1 | 1 | 12µs | 55µs | XML::LibXML::Error::BEGIN@54 |
| 1 | 1 | 1 | 12µs | 117µs | XML::LibXML::Error::BEGIN@12 |
| 1 | 1 | 1 | 11µs | 54µs | XML::LibXML::Error::BEGIN@49 |
| 1 | 1 | 1 | 11µs | 52µs | XML::LibXML::Error::BEGIN@50 |
| 1 | 1 | 1 | 11µs | 52µs | XML::LibXML::Error::BEGIN@42 |
| 1 | 1 | 1 | 11µs | 52µs | XML::LibXML::Error::BEGIN@46 |
| 1 | 1 | 1 | 11µs | 60µs | XML::LibXML::Error::BEGIN@44 |
| 1 | 1 | 1 | 11µs | 59µs | XML::LibXML::Error::BEGIN@40 |
| 1 | 1 | 1 | 11µs | 53µs | XML::LibXML::Error::BEGIN@43 |
| 1 | 1 | 1 | 11µs | 62µs | XML::LibXML::Error::BEGIN@41 |
| 1 | 1 | 1 | 11µs | 51µs | XML::LibXML::Error::BEGIN@52 |
| 1 | 1 | 1 | 11µs | 51µs | XML::LibXML::Error::BEGIN@48 |
| 1 | 1 | 1 | 10µs | 50µs | XML::LibXML::Error::BEGIN@55 |
| 1 | 1 | 1 | 10µs | 50µs | XML::LibXML::Error::BEGIN@53 |
| 1 | 1 | 1 | 10µs | 51µs | XML::LibXML::Error::BEGIN@51 |
| 1 | 1 | 1 | 10µs | 50µs | XML::LibXML::Error::BEGIN@45 |
| 1 | 1 | 1 | 10µs | 60µs | XML::LibXML::Error::BEGIN@47 |
| 0 | 0 | 0 | 0s | 0s | XML::LibXML::Error::AUTOLOAD |
| 0 | 0 | 0 | 0s | 0s | XML::LibXML::Error::DESTROY |
| 0 | 0 | 0 | 0s | 0s | XML::LibXML::Error::__ANON__[:18] |
| 0 | 0 | 0 | 0s | 0s | XML::LibXML::Error::__ANON__[:21] |
| 0 | 0 | 0 | 0s | 0s | XML::LibXML::Error::_callback_error |
| 0 | 0 | 0 | 0s | 0s | XML::LibXML::Error::_instant_error_callback |
| 0 | 0 | 0 | 0s | 0s | XML::LibXML::Error::_report_error |
| 0 | 0 | 0 | 0s | 0s | XML::LibXML::Error::_report_warning |
| 0 | 0 | 0 | 0s | 0s | XML::LibXML::Error::as_string |
| 0 | 0 | 0 | 0s | 0s | XML::LibXML::Error::domain |
| 0 | 0 | 0 | 0s | 0s | XML::LibXML::Error::dump |
| 0 | 0 | 0 | 0s | 0s | XML::LibXML::Error::int1 |
| 0 | 0 | 0 | 0s | 0s | XML::LibXML::Error::int2 |
| 0 | 0 | 0 | 0s | 0s | XML::LibXML::Error::new |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | # $Id: Error.pm,v 1.1.2.1 2004/04/20 20:09:48 pajas Exp $ | ||||
| 2 | # | ||||
| 3 | # This is free software, you may use it and distribute it under the same terms as | ||||
| 4 | # Perl itself. | ||||
| 5 | # | ||||
| 6 | # Copyright 2001-2003 AxKit.com Ltd., 2002-2006 Christian Glahn, 2006-2009 Petr Pajas | ||||
| 7 | # | ||||
| 8 | # | ||||
| 9 | package XML::LibXML::Error; | ||||
| 10 | |||||
| 11 | 3 | 48µs | 2 | 36µs | # spent 31µs (26+5) within XML::LibXML::Error::BEGIN@11 which was called
# once (26µs+5µs) by XML::LibXML::BEGIN@23 at line 11 # spent 31µs making 1 call to XML::LibXML::Error::BEGIN@11
# spent 5µs making 1 call to strict::import |
| 12 | 3 | 47µs | 2 | 222µs | # spent 117µs (12+105) within XML::LibXML::Error::BEGIN@12 which was called
# once (12µs+105µs) by XML::LibXML::BEGIN@23 at line 12 # spent 117µs making 1 call to XML::LibXML::Error::BEGIN@12
# spent 105µs making 1 call to vars::import |
| 13 | 3 | 234µs | 2 | 157µs | # spent 86µs (16+71) within XML::LibXML::Error::BEGIN@13 which was called
# once (16µs+71µs) by XML::LibXML::BEGIN@23 at line 13 # spent 86µs making 1 call to XML::LibXML::Error::BEGIN@13
# spent 71µs making 1 call to Exporter::import |
| 14 | use overload | ||||
| 15 | # spent 105µs (29+76) within XML::LibXML::Error::BEGIN@15 which was called
# once (29µs+76µs) by XML::LibXML::BEGIN@23 at line 22 | ||||
| 16 | 'eq' => sub { | ||||
| 17 | ("$_[0]" eq "$_[1]") | ||||
| 18 | }, | ||||
| 19 | 'cmp' => sub { | ||||
| 20 | ("$_[0]" cmp "$_[1]") | ||||
| 21 | }, | ||||
| 22 | 3 | 85µs | 2 | 181µs | fallback => 1; # spent 105µs making 1 call to XML::LibXML::Error::BEGIN@15
# spent 76µs making 1 call to overload::import |
| 23 | |||||
| 24 | 1 | 3µs | $WARNINGS = 0; # 0: supress, 1: report via warn, 2: report via die | ||
| 25 | 1 | 3µs | $VERSION = "1.70"; # VERSION TEMPLATE: DO NOT CHANGE | ||
| 26 | |||||
| 27 | 3 | 47µs | 2 | 155µs | # spent 84µs (14+71) within XML::LibXML::Error::BEGIN@27 which was called
# once (14µs+71µs) by XML::LibXML::BEGIN@23 at line 27 # spent 84µs making 1 call to XML::LibXML::Error::BEGIN@27
# spent 71µs making 1 call to constant::import |
| 28 | 3 | 46µs | 2 | 108µs | # spent 60µs (12+48) within XML::LibXML::Error::BEGIN@28 which was called
# once (12µs+48µs) by XML::LibXML::BEGIN@23 at line 28 # spent 60µs making 1 call to XML::LibXML::Error::BEGIN@28
# spent 48µs making 1 call to constant::import |
| 29 | 3 | 46µs | 2 | 107µs | # spent 61µs (14+47) within XML::LibXML::Error::BEGIN@29 which was called
# once (14µs+47µs) by XML::LibXML::BEGIN@23 at line 29 # spent 61µs making 1 call to XML::LibXML::Error::BEGIN@29
# spent 47µs making 1 call to constant::import |
| 30 | 3 | 46µs | 2 | 108µs | # spent 61µs (13+48) within XML::LibXML::Error::BEGIN@30 which was called
# once (13µs+48µs) by XML::LibXML::BEGIN@23 at line 30 # spent 61µs making 1 call to XML::LibXML::Error::BEGIN@30
# spent 48µs making 1 call to constant::import |
| 31 | |||||
| 32 | 3 | 46µs | 2 | 108µs | # spent 61µs (13+48) within XML::LibXML::Error::BEGIN@32 which was called
# once (13µs+48µs) by XML::LibXML::BEGIN@23 at line 32 # spent 61µs making 1 call to XML::LibXML::Error::BEGIN@32
# spent 48µs making 1 call to constant::import |
| 33 | 3 | 47µs | 2 | 162µs | # spent 88µs (13+75) within XML::LibXML::Error::BEGIN@33 which was called
# once (13µs+75µs) by XML::LibXML::BEGIN@23 at line 33 # spent 88µs making 1 call to XML::LibXML::Error::BEGIN@33
# spent 74µs making 1 call to constant::import |
| 34 | 3 | 58µs | 2 | 108µs | # spent 61µs (13+48) within XML::LibXML::Error::BEGIN@34 which was called
# once (13µs+48µs) by XML::LibXML::BEGIN@23 at line 34 # spent 61µs making 1 call to XML::LibXML::Error::BEGIN@34
# spent 48µs making 1 call to constant::import |
| 35 | 3 | 46µs | 2 | 107µs | # spent 60µs (13+47) within XML::LibXML::Error::BEGIN@35 which was called
# once (13µs+47µs) by XML::LibXML::BEGIN@23 at line 35 # spent 60µs making 1 call to XML::LibXML::Error::BEGIN@35
# spent 47µs making 1 call to constant::import |
| 36 | 3 | 45µs | 2 | 120µs | # spent 72µs (25+48) within XML::LibXML::Error::BEGIN@36 which was called
# once (25µs+48µs) by XML::LibXML::BEGIN@23 at line 36 # spent 72µs making 1 call to XML::LibXML::Error::BEGIN@36
# spent 48µs making 1 call to constant::import |
| 37 | 3 | 45µs | 2 | 107µs | # spent 59µs (12+47) within XML::LibXML::Error::BEGIN@37 which was called
# once (12µs+47µs) by XML::LibXML::BEGIN@23 at line 37 # spent 59µs making 1 call to XML::LibXML::Error::BEGIN@37
# spent 47µs making 1 call to constant::import |
| 38 | 3 | 45µs | 2 | 106µs | # spent 59µs (13+46) within XML::LibXML::Error::BEGIN@38 which was called
# once (13µs+46µs) by XML::LibXML::BEGIN@23 at line 38 # spent 59µs making 1 call to XML::LibXML::Error::BEGIN@38
# spent 46µs making 1 call to constant::import |
| 39 | 3 | 41µs | 2 | 111µs | # spent 65µs (19+46) within XML::LibXML::Error::BEGIN@39 which was called
# once (19µs+46µs) by XML::LibXML::BEGIN@23 at line 39 # spent 65µs making 1 call to XML::LibXML::Error::BEGIN@39
# spent 46µs making 1 call to constant::import |
| 40 | 3 | 40µs | 2 | 108µs | # spent 59µs (11+48) within XML::LibXML::Error::BEGIN@40 which was called
# once (11µs+48µs) by XML::LibXML::BEGIN@23 at line 40 # spent 59µs making 1 call to XML::LibXML::Error::BEGIN@40
# spent 48µs making 1 call to constant::import |
| 41 | 3 | 41µs | 2 | 114µs | # spent 62µs (11+51) within XML::LibXML::Error::BEGIN@41 which was called
# once (11µs+51µs) by XML::LibXML::BEGIN@23 at line 41 # spent 62µs making 1 call to XML::LibXML::Error::BEGIN@41
# spent 51µs making 1 call to constant::import |
| 42 | 3 | 39µs | 2 | 93µs | # spent 52µs (11+41) within XML::LibXML::Error::BEGIN@42 which was called
# once (11µs+41µs) by XML::LibXML::BEGIN@23 at line 42 # spent 52µs making 1 call to XML::LibXML::Error::BEGIN@42
# spent 41µs making 1 call to constant::import |
| 43 | 3 | 46µs | 2 | 94µs | # spent 53µs (11+42) within XML::LibXML::Error::BEGIN@43 which was called
# once (11µs+42µs) by XML::LibXML::BEGIN@23 at line 43 # spent 53µs making 1 call to XML::LibXML::Error::BEGIN@43
# spent 42µs making 1 call to constant::import |
| 44 | 3 | 38µs | 2 | 109µs | # spent 60µs (11+49) within XML::LibXML::Error::BEGIN@44 which was called
# once (11µs+49µs) by XML::LibXML::BEGIN@23 at line 44 # spent 60µs making 1 call to XML::LibXML::Error::BEGIN@44
# spent 49µs making 1 call to constant::import |
| 45 | 3 | 41µs | 2 | 91µs | # spent 50µs (10+41) within XML::LibXML::Error::BEGIN@45 which was called
# once (10µs+41µs) by XML::LibXML::BEGIN@23 at line 45 # spent 50µs making 1 call to XML::LibXML::Error::BEGIN@45
# spent 41µs making 1 call to constant::import |
| 46 | 3 | 40µs | 2 | 93µs | # spent 52µs (11+41) within XML::LibXML::Error::BEGIN@46 which was called
# once (11µs+41µs) by XML::LibXML::BEGIN@23 at line 46 # spent 52µs making 1 call to XML::LibXML::Error::BEGIN@46
# spent 41µs making 1 call to constant::import |
| 47 | 3 | 38µs | 2 | 111µs | # spent 60µs (10+50) within XML::LibXML::Error::BEGIN@47 which was called
# once (10µs+50µs) by XML::LibXML::BEGIN@23 at line 47 # spent 60µs making 1 call to XML::LibXML::Error::BEGIN@47
# spent 50µs making 1 call to constant::import |
| 48 | 3 | 52µs | 2 | 91µs | # spent 51µs (11+40) within XML::LibXML::Error::BEGIN@48 which was called
# once (11µs+40µs) by XML::LibXML::BEGIN@23 at line 48 # spent 51µs making 1 call to XML::LibXML::Error::BEGIN@48
# spent 40µs making 1 call to constant::import |
| 49 | 3 | 40µs | 2 | 96µs | # spent 54µs (11+42) within XML::LibXML::Error::BEGIN@49 which was called
# once (11µs+42µs) by XML::LibXML::BEGIN@23 at line 49 # spent 54µs making 1 call to XML::LibXML::Error::BEGIN@49
# spent 42µs making 1 call to constant::import |
| 50 | 3 | 40µs | 2 | 93µs | # spent 52µs (11+41) within XML::LibXML::Error::BEGIN@50 which was called
# once (11µs+41µs) by XML::LibXML::BEGIN@23 at line 50 # spent 52µs making 1 call to XML::LibXML::Error::BEGIN@50
# spent 41µs making 1 call to constant::import |
| 51 | 3 | 40µs | 2 | 92µs | # spent 51µs (10+41) within XML::LibXML::Error::BEGIN@51 which was called
# once (10µs+41µs) by XML::LibXML::BEGIN@23 at line 51 # spent 51µs making 1 call to XML::LibXML::Error::BEGIN@51
# spent 41µs making 1 call to constant::import |
| 52 | 3 | 38µs | 2 | 91µs | # spent 51µs (11+40) within XML::LibXML::Error::BEGIN@52 which was called
# once (11µs+40µs) by XML::LibXML::BEGIN@23 at line 52 # spent 51µs making 1 call to XML::LibXML::Error::BEGIN@52
# spent 40µs making 1 call to constant::import |
| 53 | 3 | 50µs | 2 | 89µs | # spent 50µs (10+40) within XML::LibXML::Error::BEGIN@53 which was called
# once (10µs+40µs) by XML::LibXML::BEGIN@23 at line 53 # spent 50µs making 1 call to XML::LibXML::Error::BEGIN@53
# spent 40µs making 1 call to constant::import |
| 54 | 3 | 40µs | 2 | 98µs | # spent 55µs (12+43) within XML::LibXML::Error::BEGIN@54 which was called
# once (12µs+43µs) by XML::LibXML::BEGIN@23 at line 54 # spent 55µs making 1 call to XML::LibXML::Error::BEGIN@54
# spent 43µs making 1 call to constant::import |
| 55 | 3 | 1.31ms | 2 | 90µs | # spent 50µs (10+40) within XML::LibXML::Error::BEGIN@55 which was called
# once (10µs+40µs) by XML::LibXML::BEGIN@23 at line 55 # spent 50µs making 1 call to XML::LibXML::Error::BEGIN@55
# spent 40µs making 1 call to constant::import |
| 56 | |||||
| 57 | 1 | 18µs | @error_domains = ("", "parser", "tree", "namespace", "validity", | ||
| 58 | "HTML parser", "memory", "output", "I/O", "ftp", | ||||
| 59 | "http", "XInclude", "XPath", "xpointer", "regexp", | ||||
| 60 | "Schemas datatype", "Schemas parser", "Schemas validity", | ||||
| 61 | "Relax-NG parser", "Relax-NG validity", | ||||
| 62 | "Catalog", "C14N", "XSLT", "validity"); | ||||
| 63 | |||||
| 64 | { | ||||
| 65 | |||||
| 66 | 1 | 3µs | sub new { | ||
| 67 | my ($class,$xE) = @_; | ||||
| 68 | my $terr; | ||||
| 69 | if (ref($xE)) { | ||||
| 70 | my ($context,$column) = $xE->context_and_column(); | ||||
| 71 | $terr =bless { | ||||
| 72 | domain => $xE->domain(), | ||||
| 73 | level => $xE->level(), | ||||
| 74 | code => $xE->code(), | ||||
| 75 | message => $xE->message(), | ||||
| 76 | file => $xE->file(), | ||||
| 77 | line => $xE->line(), | ||||
| 78 | str1 => $xE->str1(), | ||||
| 79 | str2 => $xE->str2(), | ||||
| 80 | str3 => $xE->str3(), | ||||
| 81 | num1 => $xE->num1(), | ||||
| 82 | num2 => $xE->num2(), | ||||
| 83 | (defined($context) ? | ||||
| 84 | ( | ||||
| 85 | context => $context, | ||||
| 86 | column => $column, | ||||
| 87 | ) : ()), | ||||
| 88 | }, $class; | ||||
| 89 | } else { | ||||
| 90 | # !!!! problem : got a flat error | ||||
| 91 | # warn("PROBLEM: GOT A FLAT ERROR $xE\n"); | ||||
| 92 | $terr =bless { | ||||
| 93 | domain => 0, | ||||
| 94 | level => 2, | ||||
| 95 | code => -1, | ||||
| 96 | message => $xE, | ||||
| 97 | file => undef, | ||||
| 98 | line => undef, | ||||
| 99 | str1 => undef, | ||||
| 100 | str2 => undef, | ||||
| 101 | str3 => undef, | ||||
| 102 | num1 => undef, | ||||
| 103 | num2 => undef, | ||||
| 104 | }, $class; | ||||
| 105 | } | ||||
| 106 | return $terr; | ||||
| 107 | } | ||||
| 108 | |||||
| 109 | sub _callback_error { | ||||
| 110 | #print "CALLBACK\n"; | ||||
| 111 | my ($xE,$prev) = @_; | ||||
| 112 | my $terr; | ||||
| 113 | $terr=XML::LibXML::Error->new($xE); | ||||
| 114 | if ($terr->{level} == XML_ERR_WARNING and $WARNINGS!=2) { | ||||
| 115 | warn $terr if $WARNINGS; | ||||
| 116 | return $prev; | ||||
| 117 | } | ||||
| 118 | #unless ( defined $terr->{file} and length $terr->{file} ) { | ||||
| 119 | # this would make it easier to recognize parsed strings | ||||
| 120 | # but it breaks old implementations | ||||
| 121 | # [CG] $terr->{file} = 'string()'; | ||||
| 122 | #} | ||||
| 123 | #warn "Saving the error ",$terr->dump; | ||||
| 124 | $terr->{_prev} = ref($prev) ? $prev : | ||||
| 125 | defined($prev) && length($prev) ? XML::LibXML::Error->new($prev) : undef; | ||||
| 126 | return $terr; | ||||
| 127 | } | ||||
| 128 | sub _instant_error_callback { | ||||
| 129 | my $xE = shift; | ||||
| 130 | my $terr= XML::LibXML::Error->new($xE); | ||||
| 131 | print "Reporting an instanteous error ",$terr->dump; | ||||
| 132 | die $terr; | ||||
| 133 | } | ||||
| 134 | sub _report_warning { | ||||
| 135 | my ($saved_error) = @_; | ||||
| 136 | #print "CALLBACK WARN\n"; | ||||
| 137 | if ( defined $saved_error ) { | ||||
| 138 | #print "reporting a warning ",$saved_error->dump; | ||||
| 139 | warn $saved_error; | ||||
| 140 | } | ||||
| 141 | } | ||||
| 142 | sub _report_error { | ||||
| 143 | my ($saved_error) = @_; | ||||
| 144 | #print "CALLBACK ERROR: $saved_error\n"; | ||||
| 145 | if ( defined $saved_error ) { | ||||
| 146 | die $saved_error; | ||||
| 147 | } | ||||
| 148 | } | ||||
| 149 | } | ||||
| 150 | |||||
| 151 | |||||
| 152 | sub AUTOLOAD { | ||||
| 153 | my $self=shift; | ||||
| 154 | return undef unless ref($self); | ||||
| 155 | my $sub = $AUTOLOAD; | ||||
| 156 | $sub =~ s/.*:://; | ||||
| 157 | if ($sub=~/^(?:code|_prev|level|file|line|domain|nodename|message|column|context|str[123]|num[12])$/) { | ||||
| 158 | return $self->{$sub}; | ||||
| 159 | } else { | ||||
| 160 | croak("Unknown error field $sub"); | ||||
| 161 | } | ||||
| 162 | } | ||||
| 163 | |||||
| 164 | # backward compatibility | ||||
| 165 | sub int1 { $_[0]->num1 } | ||||
| 166 | sub int2 { $_[0]->num2 } | ||||
| 167 | |||||
| 168 | sub DESTROY {} | ||||
| 169 | |||||
| 170 | sub domain { | ||||
| 171 | my ($self)=@_; | ||||
| 172 | return undef unless ref($self); | ||||
| 173 | return $error_domains[$self->{domain}]; | ||||
| 174 | } | ||||
| 175 | |||||
| 176 | sub as_string { | ||||
| 177 | my ($self)=@_; | ||||
| 178 | my $msg = ""; | ||||
| 179 | my $level; | ||||
| 180 | |||||
| 181 | if (defined($self->{_prev})) { | ||||
| 182 | $msg = $self->{_prev}->as_string; | ||||
| 183 | } | ||||
| 184 | |||||
| 185 | if ($self->{level} == XML_ERR_NONE) { | ||||
| 186 | $level = ""; | ||||
| 187 | } elsif ($self->{level} == XML_ERR_WARNING) { | ||||
| 188 | $level = "warning"; | ||||
| 189 | } elsif ($self->{level} == XML_ERR_ERROR || | ||||
| 190 | $self->{level} == XML_ERR_FATAL) { | ||||
| 191 | $level = "error"; | ||||
| 192 | } | ||||
| 193 | my $where=""; | ||||
| 194 | if (defined($self->{file})) { | ||||
| 195 | $where="$self->{file}:$self->{line}"; | ||||
| 196 | } elsif (($self->{domain} == XML_ERR_FROM_PARSER) | ||||
| 197 | and | ||||
| 198 | $self->{line}) { | ||||
| 199 | $where="Entity: line $self->{line}"; | ||||
| 200 | } | ||||
| 201 | if ($self->{nodename}) { | ||||
| 202 | $where.=": element ".$self->{nodename}; | ||||
| 203 | } | ||||
| 204 | $msg.=$where.": " if $where ne ""; | ||||
| 205 | $msg.=$error_domains[$self->{domain}]." ".$level." :"; | ||||
| 206 | my $str=$self->{message}||""; | ||||
| 207 | chomp($str); | ||||
| 208 | $msg.=" ".$str."\n"; | ||||
| 209 | if (($self->{domain} == XML_ERR_FROM_XPATH) and | ||||
| 210 | defined($self->{str1})) { | ||||
| 211 | $msg.=$self->{str1}."\n"; | ||||
| 212 | $msg.=(" " x $self->{num1})."^\n"; | ||||
| 213 | } elsif (defined $self->{context}) { | ||||
| 214 | my $context = $self->{context}; | ||||
| 215 | $msg.=$context."\n"; | ||||
| 216 | $context = substr($context,0,$self->{column}); | ||||
| 217 | $context=~s/[^\t]/ /g; | ||||
| 218 | $msg.=$context."^\n"; | ||||
| 219 | } | ||||
| 220 | return $msg; | ||||
| 221 | } | ||||
| 222 | |||||
| 223 | sub dump { | ||||
| 224 | my ($self)=@_; | ||||
| 225 | 3 | 16.7ms | 2 | 159µs | # spent 92µs (24+68) within XML::LibXML::Error::BEGIN@225 which was called
# once (24µs+68µs) by XML::LibXML::BEGIN@23 at line 225 # spent 92µs making 1 call to XML::LibXML::Error::BEGIN@225
# spent 68µs making 1 call to Exporter::import |
| 226 | return Data::Dumper->new([$self],['error'])->Dump; | ||||
| 227 | } | ||||
| 228 | |||||
| 229 | 1 | 45µs | 1; |