Exception: NATS::JetStream::Error::APIError

Inherits:
NATS::JetStream::Error show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/errors.rb

Overview

When the server responds with an error from the JetStream API.

Direct Known Subclasses

BadRequest, NotFound, ServerError, ServiceUnavailable

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ APIError

Returns a new instance of APIError.



46
47
48
49
50
51
52
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/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

#codeObject (readonly)

Returns the value of attribute code.



44
45
46
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/errors.rb', line 44

def code
  @code
end

#descriptionObject (readonly)

Returns the value of attribute description.



44
45
46
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/errors.rb', line 44

def description
  @description
end

#err_codeObject (readonly)

Returns the value of attribute err_code.



44
45
46
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/errors.rb', line 44

def err_code
  @err_code
end

#seqObject (readonly)

Returns the value of attribute seq.



44
45
46
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/errors.rb', line 44

def seq
  @seq
end

#streamObject (readonly)

Returns the value of attribute stream.



44
45
46
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/errors.rb', line 44

def stream
  @stream
end

Instance Method Details

#to_sObject



54
55
56
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/errors.rb', line 54

def to_s
  "#{@description} (status_code=#{@code}, err_code=#{@err_code})"
end