[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Should a response body for errors be standardized?



On Fri, Aug 08, 2003 at 09:15:13AM -0400, Joe Gregorio wrote:
>   3. Return and XML file with formatted error info:
> 
>   <error> 
>        <title>Can't create Entry</title> 
>        <description>Your bloggging service subscription has expired.  
>            Visit reup.example.com to renew your subscription 
>            today!</description> </error> 

I'm not necessarily voting for this one, but it has the benefit of
allowing error *codes* as well, which let us localize the client.

Sharing error codes between sites would be nice, too, allowing one
central localization effort, but I'm not sure there are too many codes
to share.

Here's an example snippet of error codes from our protocol that are
pretty site-specific:
  "151" => "Banned from journal",
  "152" => "Can't make back-dated entries in non-personal journal.",
  "153" => "Incorrect time value",
  "154" => "Can't add a redirected account as a friend",
  "155" => "Non-authenticated email address",
(if you're curious, the full list is about a page down in
http://cvs.livejournal.org/browse.cgi/livejournal/cgi-bin/ljprotocol.pl?rev=1.192&content-type=text/x-cvsweb-markup)


Another option for localization is to pass around the client's language
to the server on each request to let the server localize the error
messages, but that's ugly.

-- 
Evan Martin
martine@xxxxxxxxx
http://neugierig.org