Module: Blanket::Exceptions
- Defined in:
- lib/blanket/exception.rb
Overview
We will a create an exception for each status code, see www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
Constant Summary collapse
- EXCEPTIONS_MAP =
Map http status codes to the corresponding exception class
{}
Class Method Summary collapse
Class Method Details
.generate_from_response(response) ⇒ Object
91 92 93 |
# File 'lib/blanket/exception.rb', line 91 def self.generate_from_response(response) (EXCEPTIONS_MAP[response.code] || Exception).new(response) end |