Exception: NATS::JetStream::Error::APIError
- Inherits:
-
NATS::JetStream::Error
- Object
- StandardError
- IO::Error
- NATS::JetStream::Error
- NATS::JetStream::Error::APIError
- Defined in:
- lib/nats/io/jetstream/errors.rb
Overview
When the server responds with an error from the JetStream API.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#err_code ⇒ Object
readonly
Returns the value of attribute err_code.
-
#seq ⇒ Object
readonly
Returns the value of attribute seq.
-
#stream ⇒ Object
readonly
Returns the value of attribute stream.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ APIError
constructor
A new instance of APIError.
- #to_s ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ APIError
Returns a new instance of APIError.
46 47 48 49 50 51 52 |
# File 'lib/nats/io/jetstream/errors.rb', line 46 def initialize(params={}) @code = params[:code] @err_code = params[:err_code] @description = params[:description] @stream = params[:stream] @seq = params[:seq] end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
44 45 46 |
# File 'lib/nats/io/jetstream/errors.rb', line 44 def code @code end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
44 45 46 |
# File 'lib/nats/io/jetstream/errors.rb', line 44 def description @description end |
#err_code ⇒ Object (readonly)
Returns the value of attribute err_code.
44 45 46 |
# File 'lib/nats/io/jetstream/errors.rb', line 44 def err_code @err_code end |
#seq ⇒ Object (readonly)
Returns the value of attribute seq.
44 45 46 |
# File 'lib/nats/io/jetstream/errors.rb', line 44 def seq @seq end |
#stream ⇒ Object (readonly)
Returns the value of attribute stream.
44 45 46 |
# File 'lib/nats/io/jetstream/errors.rb', line 44 def stream @stream end |
Instance Method Details
#to_s ⇒ Object
54 55 56 |
# File 'lib/nats/io/jetstream/errors.rb', line 54 def to_s "#{@description} (status_code=#{@code}, err_code=#{@err_code})" end |