| 1 | package Plack::App::GraphQL::Exceptions; | ||
| 2 | |||
| 3 | 1 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 1 | extends 'Plack::Component'; | |
| 6 | |||
| 7 | 1 | has 'psgi_app' => (is=>'ro', required=>1); | |
| 8 | |||
| 9 | 0 | ▶ | sub respond_415 { |
|
Subroutine
respond_415: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 10 | 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 | 0 | ▶ | sub respond_404 { |
|
Subroutine
respond_404: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 19 | 0 | my ($self, $req) = @_; | |
| 20 | return [ | ||
| 21 | 0 | 404, | |
| 22 | ['Content-Type' => 'text/plain', 'Content-Length' => 9], | ||
| 23 | ['Not Found'] | ||
| 24 | ]; | ||
| 25 | } | ||
| 26 | |||
| 27 | 0 | ▶ | sub respond_400 { |
|
Subroutine
respond_400: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 28 | 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 | 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 | ||