line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
17
|
|
|
17
|
|
309
|
use 5.010; |
|
17
|
|
|
|
|
65
|
|
2
|
17
|
|
|
17
|
|
94
|
use strict; |
|
17
|
|
|
|
|
46
|
|
|
17
|
|
|
|
|
425
|
|
3
|
17
|
|
|
17
|
|
90
|
use warnings; |
|
17
|
|
|
|
|
39
|
|
|
17
|
|
|
|
|
461
|
|
4
|
17
|
|
|
17
|
|
95
|
use utf8; |
|
17
|
|
|
|
|
31
|
|
|
17
|
|
|
|
|
298
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Neo4j::Driver::Result::Text; |
7
|
|
|
|
|
|
|
# ABSTRACT: Fallback handler for result errors |
8
|
|
|
|
|
|
|
$Neo4j::Driver::Result::Text::VERSION = '0.40'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# This package is not part of the public Neo4j::Driver API. |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
17
|
|
|
17
|
|
1189
|
use parent 'Neo4j::Driver::Result'; |
|
17
|
|
|
|
|
57
|
|
|
17
|
|
|
|
|
109
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our @CARP_NOT = qw(Neo4j::Driver::Net::HTTP); |
16
|
|
|
|
|
|
|
|
17
|
17
|
|
|
17
|
|
1868
|
use Neo4j::Error; |
|
17
|
|
|
|
|
38
|
|
|
17
|
|
|
|
|
8143
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
#our $ACCEPT_HEADER = "text/*; q=0.1"; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub new { |
24
|
|
|
|
|
|
|
# uncoverable pod (private method) |
25
|
11
|
|
|
11
|
0
|
29
|
my ($class, $params) = @_; |
26
|
|
|
|
|
|
|
|
27
|
11
|
|
|
|
|
23
|
my $header = $params->{http_header}; |
28
|
11
|
|
|
|
|
19
|
my $error = 'Neo4j::Error'; |
29
|
|
|
|
|
|
|
|
30
|
11
|
100
|
100
|
|
|
74
|
if (! $header->{success} && ! $header->{status}) { |
|
|
100
|
|
|
|
|
|
31
|
|
|
|
|
|
|
# Response generated internally by the networking module |
32
|
1
|
|
|
|
|
7
|
$error = $error->append_new( Network => sprintf("HTTP error: %s", $params->{http_agent}->http_reason) ); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
elsif (! $header->{success}) { |
35
|
|
|
|
|
|
|
$error = $error->append_new( Network => { |
36
|
|
|
|
|
|
|
code => $header->{status}, |
37
|
4
|
|
|
|
|
18
|
as_string => sprintf("HTTP error: %s %s on %s to %s", $header->{status}, $params->{http_agent}->http_reason, $params->{http_method}, $params->{http_path}), |
38
|
|
|
|
|
|
|
}); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
11
|
|
|
|
|
28506
|
my ($content_type) = $header->{content_type} =~ m/^\s*([^\s;]*)/; |
42
|
11
|
100
|
66
|
|
|
72
|
if (lc $content_type eq 'text/plain') { |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
43
|
|
|
|
|
|
|
$error = $error->append_new( Internal => { |
44
|
|
|
|
|
|
|
as_string => $params->{http_agent}->fetch_all, |
45
|
6
|
|
|
|
|
30
|
}); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
elsif ($content_type =~ m{^text/html\b|^application/xhtml\b}i) { |
48
|
3
|
|
|
|
|
9
|
my $raw = $params->{http_agent}->fetch_all; |
49
|
3
|
|
|
|
|
40
|
my ($title) = $raw =~ m{([^<]*)}i; |
50
|
3
|
100
|
|
|
|
32
|
$error = $error->append_new( Internal => { |
51
|
|
|
|
|
|
|
as_string => sprintf("Received HTML content%s from server (Is this a Neo4j server?)", $title ? " \"$title\"" : ""), |
52
|
|
|
|
|
|
|
raw => $raw, |
53
|
|
|
|
|
|
|
}); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
elsif ($content_type || $header->{status}) { |
56
|
|
|
|
|
|
|
$error = $error->append_new( Internal => { |
57
|
|
|
|
|
|
|
as_string => sprintf("Received %s content from database server; skipping result parsing", $content_type || "empty"), |
58
|
|
|
|
|
|
|
raw => $params->{http_agent}->fetch_all, |
59
|
1
|
|
50
|
|
|
9
|
}); |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
11
|
|
|
|
|
23548
|
return bless { _error => $error }, $class; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
|
66
|
11
|
|
|
11
|
|
38
|
sub _info { shift } |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
69
|
1
|
|
|
1
|
|
28
|
sub _results { () } # no actual results provided here |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
# sub _accept_header { () } |
73
|
|
|
|
|
|
|
# |
74
|
|
|
|
|
|
|
# |
75
|
|
|
|
|
|
|
# sub _acceptable { |
76
|
|
|
|
|
|
|
# my ($class, $content_type) = @_; |
77
|
|
|
|
|
|
|
# |
78
|
|
|
|
|
|
|
# return $_[1] =~ m|^text/|i; |
79
|
|
|
|
|
|
|
# } |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
1; |