line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Plack::App::GraphQL::Exceptions; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
909
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
14
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
extends 'Plack::Component'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
has 'psgi_app' => (is=>'ro', required=>1); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub respond_415 { |
10
|
0
|
|
|
0
|
0
|
|
my ($self, $req) = @_; |
11
|
|
|
|
|
|
|
return [ |
12
|
0
|
|
|
|
|
|
415, |
13
|
|
|
|
|
|
|
['Content-Type' => 'text/plain', 'Content-Length' => 22], |
14
|
|
|
|
|
|
|
['Unsupported Media Type'] |
15
|
|
|
|
|
|
|
]; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub respond_404 { |
19
|
0
|
|
|
0
|
0
|
|
my ($self, $req) = @_; |
20
|
|
|
|
|
|
|
return [ |
21
|
0
|
|
|
|
|
|
404, |
22
|
|
|
|
|
|
|
['Content-Type' => 'text/plain', 'Content-Length' => 9], |
23
|
|
|
|
|
|
|
['Not Found'] |
24
|
|
|
|
|
|
|
]; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub respond_400 { |
28
|
0
|
|
|
0
|
0
|
|
my ($self, $req) = @_; |
29
|
|
|
|
|
|
|
return [ |
30
|
0
|
|
|
|
|
|
400, |
31
|
|
|
|
|
|
|
['Content-Type' => 'text/plain', 'Content-Length' => 11], |
32
|
|
|
|
|
|
|
['Bad Request'] |
33
|
|
|
|
|
|
|
]; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 NAME |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
Plack::App::GraphQL::Exceptions - Return PSGI Exception Responses |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 SYNOPSIS |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
TBD |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 DESCRIPTION |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Module to encapsulate exception responses. We isolate this in case you are fussy |
49
|
|
|
|
|
|
|
and have special needs in how your exceptions are returned. |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 AUTHOR |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
John Napiorkowski |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 SEE ALSO |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
L<GraphQL>, L<Plack>, L<Plack::App::GraphQL> |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=cut |