[DAS2] Re: New problem with content-type header in DAS/2 server responses!
Thomas Down
td2 at sanger.ac.uk
Fri Nov 11 09:24:52 UTC 2005
On 10 Nov 2005, at 19:49, Andrew Dalke wrote:
> Ed:
>
>> Using the HTTP-level error codes can cause problems.
>>
>
>
>> I don't care if status code is indicated with a header like
>> "X-DAS-Status: 200" or with some XML content, or with both. But I
>> think the HTTP status code has to be a separate thing, and will
>> usually be "400" indicating that the user (sorry, I meant to say
>> LeRoy) successfully communicated with the DAS server.
>>
>
> Okay, sounds like using HTTP codes for this causes problems in
> practice.
>
> What about returning a different content-type for that case?
>
> 200 Ok
> Content-Type: application/x-das-error
>
> <body>
> Something bad happened.
> </body>
That looks reasonable, but could we add a bit of structure:
<dasError>
<faultCode>407</faultCode>
<description>The sky is falling</description>
</dasError>
(There's also a possible argument for using textual, rather than
numeric, error codes -- but it would be good to keep at least one
part of the error response using a well-defined vocabulary for the
benefit of clients that want to respond to different error conditions
in different ways).
Thomas.
More information about the DAS2
mailing list