1HTTP::OAI::Error(3pm) User Contributed Perl DocumentationHTTP::OAI::Error(3pm)
2
3
4

NAME

6       HTTP::OAI::Error - Encapsulates OAI error codes
7

METHODS

9       $err = new HTTP::OAI::Error(code=>'badArgument',[message=>'An incorrect
10       argument was supplied'])
11           This constructor method returns a new HTTP::OAI::Error object.
12
13           If no message is specified, and the code is a valid OAI error code,
14           the appropriate message from the OAI protocol document is the
15           default message.
16
17       $code = $err->code([$code])
18           Returns and optionally sets the error name.
19
20       $msg = $err->message([$msg])
21           Returns and optionally sets the error message.
22

NOTE - noRecordsMatch

24       noRecordsMatch, without additional errors, is not treated as an error
25       code. If noRecordsMatch was returned by a repository the
26       HTTP::OAI::Response object will have a verb 'error' and will contain
27       the noRecordsMatch error, however is_success will return true.
28
29       e.g.
30
31               my $r = $ha->ListIdentifiers(metadataPrefix='oai_dc',from=>'3000-02-02');
32
33               if( $r->is_success ) {
34                       print "Successful\n";
35               } else {
36                       print "Failed\n";
37               }
38
39               print $r->verb, "\n";
40
41       Will print "Successful" followed by "error".
42
43
44
45perl v5.28.1                      2018-11-26             HTTP::OAI::Error(3pm)
Impressum