Exception: OpenReceive::Server::Swap::FixedFloatApiError
- Inherits:
-
StandardError
- Object
- StandardError
- OpenReceive::Server::Swap::FixedFloatApiError
- Defined in:
- lib/openreceive/server/swap/fixedfloat.rb
Overview
Ruby port of the FixedFloatApiError from packages/js/node/src/swap/fixedfloat.ts. Deliberately does NOT expose #status/#code: the request handler duck-types those for wire mapping, and a provider failure must reach the payer as the redacted 500 "Internal server error." exactly like the JS engine.
Constant Summary collapse
- KINDS =
%w[api http invalid_json network rate_limited timeout].freeze
Instance Attribute Summary collapse
-
#fixedfloat_code ⇒ Object
readonly
Returns the value of attribute fixedfloat_code.
-
#fixedfloat_message ⇒ Object
readonly
Returns the value of attribute fixedfloat_message.
-
#http_status ⇒ Object
readonly
Returns the value of attribute http_status.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(path:, kind:, message:, http_status: nil, fixedfloat_code: nil, fixedfloat_message: nil) ⇒ FixedFloatApiError
constructor
A new instance of FixedFloatApiError.
Constructor Details
#initialize(path:, kind:, message:, http_status: nil, fixedfloat_code: nil, fixedfloat_message: nil) ⇒ FixedFloatApiError
Returns a new instance of FixedFloatApiError.
24 25 26 27 28 29 30 31 32 |
# File 'lib/openreceive/server/swap/fixedfloat.rb', line 24 def initialize(path:, kind:, message:, http_status: nil, fixedfloat_code: nil, fixedfloat_message: nil) super() @path = path @kind = kind @http_status = http_status @fixedfloat_code = fixedfloat_code @fixedfloat_message = end |
Instance Attribute Details
#fixedfloat_code ⇒ Object (readonly)
Returns the value of attribute fixedfloat_code.
22 23 24 |
# File 'lib/openreceive/server/swap/fixedfloat.rb', line 22 def fixedfloat_code @fixedfloat_code end |
#fixedfloat_message ⇒ Object (readonly)
Returns the value of attribute fixedfloat_message.
22 23 24 |
# File 'lib/openreceive/server/swap/fixedfloat.rb', line 22 def @fixedfloat_message end |
#http_status ⇒ Object (readonly)
Returns the value of attribute http_status.
22 23 24 |
# File 'lib/openreceive/server/swap/fixedfloat.rb', line 22 def http_status @http_status end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
22 23 24 |
# File 'lib/openreceive/server/swap/fixedfloat.rb', line 22 def kind @kind end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
22 23 24 |
# File 'lib/openreceive/server/swap/fixedfloat.rb', line 22 def path @path end |
Class Method Details
.from_transport_error(path, error) ⇒ Object
34 35 36 37 38 39 40 41 42 |
# File 'lib/openreceive/server/swap/fixedfloat.rb', line 34 def self.from_transport_error(path, error) aborted = Swap.timeout_error?(error) new( path: path, kind: aborted ? "timeout" : "network", message: aborted ? "FixedFloat #{path} request timed out." : "FixedFloat #{path} request failed before a response was received." ) end |