Class: NATS::JetStream::Error::APIError

Inherits:
NATS::JetStream::Error show all
Defined in:
lib/nats/io/js.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.



1074
1075
1076
1077
1078
1079
1080
# File 'lib/nats/io/js.rb', line 1074

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.



1072
1073
1074
# File 'lib/nats/io/js.rb', line 1072

def code
  @code
end

#descriptionObject (readonly)

Returns the value of attribute description.



1072
1073
1074
# File 'lib/nats/io/js.rb', line 1072

def description
  @description
end

#err_codeObject (readonly)

Returns the value of attribute err_code.



1072
1073
1074
# File 'lib/nats/io/js.rb', line 1072

def err_code
  @err_code
end

#seqObject (readonly)

Returns the value of attribute seq.



1072
1073
1074
# File 'lib/nats/io/js.rb', line 1072

def seq
  @seq
end

#streamObject (readonly)

Returns the value of attribute stream.



1072
1073
1074
# File 'lib/nats/io/js.rb', line 1072

def stream
  @stream
end

Instance Method Details

#to_sObject



1082
1083
1084
# File 'lib/nats/io/js.rb', line 1082

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