[OAI-implementers] Error reporting from OAI implementations

Thomas G. Habing thabing@uiuc.edu
Mon, 07 May 2001 09:58:51 -0500


Hi Jozef,

Check section 3.1.2.2, Status-Code, in the OAI spec.  Essentially this error
would require that you return an HTTP status code of 400.  However, in
addition to the HTTP Status-Code you may also want to send a human-readable
Reason-Phrase (See section 6.1, Status-Line, in the HTTP protocol spec:
ftp://ftp.isi.edu/in-notes/rfc2616.txt).

In the case of a missing metadataPrefix, I use:

  400 Bad Request ('metadataPrefix' is a required parameter)

Just for good measure I also send an error message in the body of the HTML
response, such as:

<?xml version="1.0" encoding="UTF-8" ?> 
 <html xmlns="http://www.w3.org/1999/xhtml">
  <head>
   <title>400 Bad Request ('metadataPrefix' is a required parameter)</title> 
  </head>
  <body>
   <h4>400 Bad Request ('metadataPrefix' is a required parameter)</h4> 
  
<p>http://bolder.grainger.uiuc.edu/oaisimple/oai.asp?verb=GetRecord&identifier=oai:uiuc:184500</p> 
  </body>
 </html>

but this probably isn't that useful in a protocol which is mostly for
machine consumption.

Does anyone else think it might be useful to define some standard (or
recommended) HTTP Reason-Phrases in the OAI spec?  This might make it easier
to diagnose problems from web logs; instead of error '400' or '400 Bad
Request', you've got '400 Missing metadatPrefix'.  Plus it would give
protocol implementers one less thing to have to think about.

Kind regards,
		Tom

-- 
Thomas G. Habing
Research Programmer, Digital Library Initiative
University of Illinois at Urbana-Champaign
052 Grainger Engineering Library, MC-274
thabing@uiuc.edu, (217) 244-7809


> Jozef Kruger wrote:
> 
> Hello everybody,
> 
> As a programmer for Adlib Information Systems (the Netherlands), I am
> implementing the OAI protocol for our database. I have a question about
> the error reporting. When an OAI-call is done, with for instance the wrong
> parameters (e.g. metadataPrefix is missing), how do I correctly report the
> error. Is there a standard way for doing this? And if so, what way? :)
> 
> thanks very much.
> 
> Jozef Kruger