Skip to content

Ability to read content after catching exception #29

Open
davidekholm opened this Issue Sep 6, 2013 · 3 comments

3 participants

@davidekholm

As you may know, some RESTful servers provide additional information about an error in the http content, but with today's Resty implementation one simpy gets an IOException if there is a 500 server error. Now it's impossible to dig further as the IOException carries no further information :-(

I've made a tiny and fully compatible adjustment to a subclass of Resty to handle this. I let Resty catch IOExeptions, and re-throw RestyExceptions instead. These RestyExceptions are simply subclasses of IOExceptions that embeds an AbstractResource. Problem solved :-)

I'd be happy to provide you my implementation. As I said, it's a tiny and fully compatible adjustment. It does not require any changes to existing users of your library. It just makes it better. My implementation also allows a user to add additional http request parameters which is required by some servers.

Just email me at david@jalbum.net and I'll contribute my code!

@beders
Owner
beders commented Sep 7, 2013
@davidekholm
@jpasqua
jpasqua commented Apr 18, 2014

Any chance that the exception handling changes will be folded into Resty? It would be really helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.