abdera-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexandre Bairos" <alexandre.bai...@gmail.com>
Subject Re: Error messages
Date Mon, 05 May 2008 23:35:06 GMT
I'm using something in the lines of

<?xml version='1.0' encoding='UTF8'?>
<error xmlns="http://incubator.apache.org/abdera">
    <code>1400</code>
    <message>InvalidArticleTitle</message>
</error>


which Abdera has out of the box with some minor adjustments.

These error elements comes in a http error response, with 400, 500, etc.
Google Gdata has a <reason/> and <input/> subelements.
For Bad request errors, an errors root element would do the trick of
returning multiple errors like in the following snippet:

<?xml version='1.0' encoding='UTF8'?>
<errors>
<error xmlns="http://incubator.apache.org/abdera">
    <code>1400</code>
    <message>InvalidArticleTitle</message>
</error>
<error xmlns="http://incubator.apache.org/abdera">
    <code>1401</code>
    <message>InvalidArticleBodyLength</message>
</error>
</errors>


Alexandre Bairos


On Mon, May 5, 2008 at 12:57 PM, Remy Gendron <remy@arrova.ca> wrote:

> Hello all,
>
>
>
> I am currently implementing server side validations (for those interested,
> using Spring validation package with Hibernate Validator for the simple
> validations).
>
>
>
> Any of you have recommendations/insights as to the returned XML payload
> when
> errors are encountered?
>
>
>
> I need to return something like a list of error object designators, the
> error codes and a default, non localized human readable error message.
>
>
>
> I was considering returning this as a feed collection, each error being
> wrapped in an entry. Or do you recommend a specific XML schema for the
> errors? Or something else?
>
>
>
> Some might say that the error code should be enough. However, I would like
> to give the caller the opportunity to provide the user with a minimum of
> information when errors are reported.
>
>
>
> Thanks,
>
>
>
> Rémy
>
>
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message