# Correct format for errors returned from a REST server?

**URL:** <https://www.ruby-forum.com/t/correct-format-for-errors-returned-from-a-rest-server/173120>\
**Category:** Rails\
**Created:** [August 3, 2009, 1:31pm UTC](https://www.ruby-forum.com/t/correct-format-for-errors-returned-from-a-rest-server/173120 "2009-08-03T13:31:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [August 3, 2009, 1:31pm UTC](https://www.ruby-forum.com/t/correct-format-for-errors-returned-from-a-rest-server/173120/1 "2009-08-03T13:31:07Z")

</div>

What’s the correct format for returning informative errors from a REST  
server. Error code 500 isn’t enough. I want to see a description of the  
error, but how can I format the XML correctly to put some useful  
information in.

This is a Rails client working with a non-Rails server.

Thanks

John S.

---

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [August 3, 2009, 2:48pm UTC](https://www.ruby-forum.com/t/correct-format-for-errors-returned-from-a-rest-server/173120/2 "2009-08-03T14:48:59Z")

</div>

On Aug 3, 5:31 am, John S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> What’s the correct format for returning informative errors from a REST  
> server. Error code 500 isn’t enough. I want to see a description of the  
> error, but how can I format the XML correctly to put some useful  
> information in.

a few links here might help.  
[http://www.google.com/search?rlz=1C1CHMA\_enUS312US312&sourceid=chrome&ie=UTF-8&q=rails+how+to+render+500+text](http://www.google.com/search?rlz=1C1CHMA_enUS312US312&sourceid=chrome&ie=UTF-8&q=rails+how+to+render+500+text)

---

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [August 3, 2009, 4:38pm UTC](https://www.ruby-forum.com/t/correct-format-for-errors-returned-from-a-rest-server/173120/3 "2009-08-03T16:38:56Z")

</div>

> a few links here might help.  
> [rails how to render 500 text - Google Search](http://www.google.com/search?rlz=1C1CHMA_enUS312US312&sourceid=chrome&ie=UTF-8&q=rails+how+to+render+500+text)

Those links seem to be mostly about formating code 500 errors for public  
viewing on a webpage.

I think the easiest way to do this is to create a Rails REST server,  
force it to have a code 500 error, and then see what it sends to the  
client. That way I’ll find something about how the Rails client expects  
to see code 500 errors presented in a REST conversation. I’ll do that  
later on today.

John S.
