line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTTP::OAI::Error; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
@ISA = qw( HTTP::OAI::SAX::Base HTTP::OAI::MemberMixin Exporter ); |
4
|
|
|
|
|
|
|
|
5
|
11
|
|
|
11
|
|
73
|
use strict; |
|
11
|
|
|
|
|
24
|
|
|
11
|
|
|
|
|
372
|
|
6
|
|
|
|
|
|
|
|
7
|
11
|
|
|
11
|
|
57
|
use vars qw(@EXPORT @EXPORT_OK %EXPORT_TAG); |
|
11
|
|
|
|
|
21
|
|
|
11
|
|
|
|
|
4230
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '4.13'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
@EXPORT = qw(); |
12
|
|
|
|
|
|
|
@EXPORT_OK = qw(%OAI_ERRORS); |
13
|
|
|
|
|
|
|
%EXPORT_TAG = (); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my %OAI_ERRORS = ( |
16
|
|
|
|
|
|
|
badArgument => 'The request includes illegal arguments, is missing required arguments, includes a repeated argument, or values for arguments have an illegal syntax.', |
17
|
|
|
|
|
|
|
# badGranularity => 'The values of the from and until arguments are illegal or specify a finer granularity than is supported by the repository.', |
18
|
|
|
|
|
|
|
badResumptionToken => 'The value of the resumptionToken argument is invalid or expired.', |
19
|
|
|
|
|
|
|
badVerb => 'Value of the verb argument is not a legal OAI-PMH verb, the verb argument is missing, or the verb argument is repeated.', |
20
|
|
|
|
|
|
|
cannotDisseminateFormat => 'The metadata format identified by the value given for the metadataPrefix argument is not supported by the item or by the repository', |
21
|
|
|
|
|
|
|
idDoesNotExist => 'The value of the identifier argument is unknown or illegal in this repository.', |
22
|
|
|
|
|
|
|
noRecordsMatch => 'The combination of the values of the from, until, set, and metadataPrefix arguments results in an empty list.', |
23
|
|
|
|
|
|
|
noMetadataFormats => 'There are no metadata formats available for the specified item.', |
24
|
|
|
|
|
|
|
noSetHierarchy => 'The repository does not support sets.' |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub new |
28
|
|
|
|
|
|
|
{ |
29
|
6
|
|
|
6
|
1
|
27
|
my( $class, %self ) = @_; |
30
|
|
|
|
|
|
|
|
31
|
6
|
100
|
66
|
|
|
38
|
$self{message} ||= $OAI_ERRORS{$self{code}} if $self{code}; |
32
|
|
|
|
|
|
|
|
33
|
6
|
|
|
|
|
32
|
return $class->SUPER::new(%self); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
12
|
|
|
12
|
1
|
191
|
sub code { shift->_elem('code',@_) } |
37
|
7
|
|
|
7
|
1
|
80
|
sub message { shift->_elem('message',@_) } |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub generate |
40
|
|
|
|
|
|
|
{ |
41
|
1
|
|
|
1
|
0
|
3
|
my( $self, $driver ) = @_; |
42
|
|
|
|
|
|
|
|
43
|
1
|
|
50
|
|
|
4
|
$driver->data_element( 'error', ($self->message || $OAI_ERRORS{$self->code} || ''), |
44
|
|
|
|
|
|
|
code => $self->code, |
45
|
|
|
|
|
|
|
); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub start_element |
49
|
|
|
|
|
|
|
{ |
50
|
2
|
|
|
2
|
1
|
46
|
my( $self, $hash ) = @_; |
51
|
|
|
|
|
|
|
|
52
|
2
|
|
|
|
|
7
|
$self->code( $hash->{Attributes}->{'{}code'}->{Value} ); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub characters |
56
|
|
|
|
|
|
|
{ |
57
|
2
|
|
|
2
|
1
|
52
|
my( $self, $hash ) = @_; |
58
|
|
|
|
|
|
|
|
59
|
2
|
|
|
|
|
6
|
$self->message( $hash->{Data} ); |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
__END__ |