Whether or not we can (or want to) do this for 3.6, I agree that a
400-series error is more appropriate here, since the system is able to
respond correctly and the problem is at a different semantic level than the
HTTP protocol.

Perhaps a 422 (Unprocessable Entity)? Unfortunately, this is a WebDAV
extension, but the semantics very good for this case. See:
http://tools.ietf.org/html/rfc4918.

The 422 (Unprocessable Entity) status code means the server understands the
> content type of the request entity (hence a 415(Unsupported Media Type)
> status code is inappropriate), and the syntax of the request entity is
> correct (thus a 400 (Bad Request) status code is inappropriate) but was
> unable to process the contained instructions. For example, this error
> condition may occur if an XML request body contains well-formed (i.e.,
> syntactically correct), but semantically erroneous, XML instructions.
>

---
A. Soroka
Software and Systems Engineering
Online Library Environment
the University of Virginia Library

On Fri, Jan 27, 2012 at 5:20 AM, Stephen Bayliss <
stephen.bayl...@acuityunlimited.net> wrote:

> **
> <snipped>
> * HTTP response code for REST API operations:  Currently if an ingest
> fails XML validation this is reported via HTTP status code 500 (Server
> Error).  To maintain consistency with the existing behaviour, object
> validation failures will also result in this code, with the text of the
> exception containing details of the validation failure.  I'd suggest that
> maybe 400 - Bad Request [1] might be more appropriate for both of these;
> but this would essentially represent a REST API change - would that be
> acceptable for a Fedora 3.6 release?  If this change was made I'd suggest
> implementing this by catching ObjectValidityException at the API level, and
> extending this exception to contain details of the validation failure for
> the response body (rather than the 500 exception reporting that occurs
> currently).
> <snipped>
>
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Fedora-commons-developers mailing list
Fedora-commons-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fedora-commons-developers

Reply via email to