Exception: Io::Flow::V0::HttpClient::ServerError
- Inherits:
-
StandardError
- Object
- StandardError
- Io::Flow::V0::HttpClient::ServerError
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
- #body_json ⇒ Object
-
#initialize(code, details, incoming = {}) ⇒ ServerError
constructor
A new instance of ServerError.
- #message ⇒ Object
Constructor Details
#initialize(code, details, incoming = {}) ⇒ ServerError
Returns a new instance of ServerError.
54415 54416 54417 54418 54419 54420 54421 54422 54423 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54415 def initialize(code, details, incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) @code = HttpClient::Preconditions.assert_class('code', code, Integer) @details = HttpClient::Preconditions.assert_class('details', details, String) @body = HttpClient::Preconditions.assert_class_or_nil('body', opts.delete(:body), String) @uri = HttpClient::Preconditions.assert_class_or_nil('uri', opts.delete(:uri), String) HttpClient::Preconditions.assert_empty_opts(opts) super(self.) end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
54413 54414 54415 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54413 def body @body end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
54413 54414 54415 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54413 def code @code end |
#details ⇒ Object (readonly)
Returns the value of attribute details.
54413 54414 54415 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54413 def details @details end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
54413 54414 54415 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54413 def uri @uri end |
Instance Method Details
#body_json ⇒ Object
54433 54434 54435 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54433 def body_json @body ? JSON.parse(@body) : nil end |
#message ⇒ Object
54425 54426 54427 54428 54429 54430 54431 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54425 def m = "%s %s" % [@code, @details] if @body m << ": %s" % @body end m end |