Comment 5 for bug 952618

Revision history for this message
John Postlethwait (john-postlethwait) wrote :

In practice any time an exception is raised it should be done so using, at least, the base GlanceException class as a means to catch them and do something with them outside of this code.

The code here would cast any unexpected HTTP status code as a base Exception and is thusly difficult to deal with. We encountered this in Horizon the other day with the 503's and ended up having to deal with the exception based not on the exception class itself, but on the actual string error message which is kludgy and difficult.

I'm not proposing extra conditionals, but using a different error class than Exception is really what this bug is about. You shouldn't need to create a new error class to achieve this, using GlanceException would be much more preferable and manageable than using Exception.