line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
17
|
|
|
17
|
|
310
|
use 5.010; |
|
17
|
|
|
|
|
80
|
|
2
|
17
|
|
|
17
|
|
98
|
use strict; |
|
17
|
|
|
|
|
42
|
|
|
17
|
|
|
|
|
383
|
|
3
|
17
|
|
|
17
|
|
95
|
use warnings; |
|
17
|
|
|
|
|
49
|
|
|
17
|
|
|
|
|
473
|
|
4
|
17
|
|
|
17
|
|
95
|
use utf8; |
|
17
|
|
|
|
|
43
|
|
|
17
|
|
|
|
|
274
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Neo4j::Driver::Result::Text; |
7
|
|
|
|
|
|
|
# ABSTRACT: Fallback handler for result errors |
8
|
|
|
|
|
|
|
$Neo4j::Driver::Result::Text::VERSION = '0.38'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# This package is not part of the public Neo4j::Driver API. |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
17
|
|
|
17
|
|
1094
|
use parent 'Neo4j::Driver::Result'; |
|
17
|
|
|
|
|
47
|
|
|
17
|
|
|
|
|
114
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our @CARP_NOT = qw(Neo4j::Driver::Net::HTTP); |
16
|
|
|
|
|
|
|
|
17
|
17
|
|
|
17
|
|
1822
|
use Neo4j::Error; |
|
17
|
|
|
|
|
44
|
|
|
17
|
|
|
|
|
8214
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
#our $ACCEPT_HEADER = "text/*; q=0.1"; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub new { |
24
|
|
|
|
|
|
|
# uncoverable pod (private method) |
25
|
11
|
|
|
11
|
0
|
35
|
my ($class, $params) = @_; |
26
|
|
|
|
|
|
|
|
27
|
11
|
|
|
|
|
22
|
my $header = $params->{http_header}; |
28
|
11
|
|
|
|
|
20
|
my $error = 'Neo4j::Error'; |
29
|
|
|
|
|
|
|
|
30
|
11
|
100
|
100
|
|
|
91
|
if (! $header->{success} && ! $header->{status}) { |
|
|
100
|
|
|
|
|
|
31
|
|
|
|
|
|
|
# Response generated internally by the networking module |
32
|
1
|
|
|
|
|
5
|
$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
|
|
|
|
|
24
|
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
|
|
|
|
|
27681
|
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
|
|
|
|
|
35
|
}); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
elsif ($content_type =~ m{^text/html\b|^application/xhtml\b}i) { |
48
|
3
|
|
|
|
|
8
|
my $raw = $params->{http_agent}->fetch_all; |
49
|
3
|
|
|
|
|
44
|
my ($title) = $raw =~ m{([^<]*)}i; |
50
|
3
|
100
|
|
|
|
27
|
$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
|
|
|
10
|
}); |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
11
|
|
|
|
|
23574
|
$params->{error_handler}->($error); |
63
|
|
|
|
|
|
|
|
64
|
1
|
|
|
|
|
1348
|
return bless {}, $class; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
68
|
1
|
|
|
1
|
|
5
|
sub _info { {} } # no transaction status info => treat as closed |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
71
|
1
|
|
|
1
|
|
10
|
sub _results { () } # no actual results provided here |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
# sub _accept_header { () } |
75
|
|
|
|
|
|
|
# |
76
|
|
|
|
|
|
|
# |
77
|
|
|
|
|
|
|
# sub _acceptable { |
78
|
|
|
|
|
|
|
# my ($class, $content_type) = @_; |
79
|
|
|
|
|
|
|
# |
80
|
|
|
|
|
|
|
# return $_[1] =~ m|^text/|i; |
81
|
|
|
|
|
|
|
# } |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
1; |