Exception: OpenReceive::Server::ServiceError
- Inherits:
-
StandardError
- Object
- StandardError
- OpenReceive::Server::ServiceError
- Defined in:
- lib/openreceive/server/errors.rb
Overview
Generic service error carrying an explicit HTTP status + canonical code, the Ruby analogue of the JS ServiceError. Used where the JS service raises serviceError(status, code, message) — e.g. the swap flows — so both engines put the same status/code/message on the wire.
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#retryable ⇒ Object
readonly
Returns the value of attribute retryable.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(status, code, message, retryable: nil, details: nil) ⇒ ServiceError
constructor
A new instance of ServiceError.
Constructor Details
#initialize(status, code, message, retryable: nil, details: nil) ⇒ ServiceError
Returns a new instance of ServiceError.
15 16 17 18 19 20 21 |
# File 'lib/openreceive/server/errors.rb', line 15 def initialize(status, code, , retryable: nil, details: nil) super() @status = status @code = code @retryable = retryable @details = details end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
13 14 15 |
# File 'lib/openreceive/server/errors.rb', line 13 def code @code end |
#details ⇒ Object (readonly)
Returns the value of attribute details.
13 14 15 |
# File 'lib/openreceive/server/errors.rb', line 13 def details @details end |
#retryable ⇒ Object (readonly)
Returns the value of attribute retryable.
13 14 15 |
# File 'lib/openreceive/server/errors.rb', line 13 def retryable @retryable end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
13 14 15 |
# File 'lib/openreceive/server/errors.rb', line 13 def status @status end |