Class: FHTTPClient::Processor::Exception
- Defined in:
- lib/f_http_client/processor/exception.rb
Overview
This Service proccess a HTTP exception generating failure result.
Example:
def process
error = Errno::ECONNREFUSED.new('Failed to open TCP connection to :80')
FHTTPClient::Processor::ResponseProcessor.(error: error)
.on_failure(:connection_refused) { return 'The server has been refused the connection.' }
.on_failure { || return "Generic #{}" }
end
proccess # => ‘The server has been refused the connection.’
Instance Method Summary collapse
Instance Method Details
#run ⇒ Object
22 23 24 |
# File 'lib/f_http_client/processor/exception.rb', line 22 def run log_data.and_then { Failure(error_name, :exception, data: error) } end |