| 1 | package Interchange::Search::Solr::Response; | ||
| 2 | |||
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use Any::Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 6 | extends 'WebService::Solr::Response'; | ||
| 7 | |||
| 8 | =head1 NAME | ||
| 9 | |||
| 10 | Interchange::Search::Solr::Response | ||
| 11 | |||
| 12 | =head2 DESCRIPTION | ||
| 13 | |||
| 14 | L<WebService::Solr::Response> subclass for error handling. | ||
| 15 | |||
| 16 | =head2 METHODS/ACCESSORS | ||
| 17 | |||
| 18 | In addition to all the L<WebService::Solr::Response> methods this | ||
| 19 | class have the following methods: | ||
| 20 | |||
| 21 | =head3 error | ||
| 22 | |||
| 23 | An error string. | ||
| 24 | |||
| 25 | =head3 is_empty_search | ||
| 26 | |||
| 27 | Error code is C<empty_search>. | ||
| 28 | |||
| 29 | =cut | ||
| 30 | |||
| 31 | has error => (is => 'rw'); | ||
| 32 | |||
| 33 | sub is_empty_search { | ||
| 34 | my $self = shift; | ||
| 35 | if (my $error = $self->error) { | ||
| 36 | return $error eq 'empty_search'; | ||
| 37 | } | ||
| 38 | return 0; | ||
| 39 | } | ||
| 40 | |||
| 41 | |||
| 42 | 1; | ||
| 43 | |||