move interpret_http_exception() here from snarfed/bridgy