ets-berkeley-edu/calcentral — pull request #2077 by ctweney (2014-02-04 17:35:45+00:00)
Title: CLC-3197 Generic proxy error handling scheme (initial)

https://jira.media.berkeley.edu/jira/browse/CLC-3197

This is just a down payment on refactoring all the proxies to use the same generic exception handling scheme.

Proxies can deal with remote error states that did not throw exceptions (e.g. 404s) by throwing their own new Calcentral::ProxyException. This exception takes a response body and a log error message. Uncaught exceptions (eg connection timeout, unreachable host, etc) are similar, but don't need to be declared. The BaseProxy handling class will log the error and return the response to the user, and then expire the proxy's cache entry at a delay of 5 seconds, via the DelayedCacheCleaner.

This pull also brings in a much smarter way of detecting whether TorqueBox is running or not, eliminating the stupid messaging.enabled setting.

If this pattern meets with general approval I'll apply it to all the other subclasses of BaseProxy.