Class: NATS::KeyValue::KeyNotFoundError

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

Overview

When a key is not found.

Direct Known Subclasses

KeyDeletedError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ KeyNotFoundError

Returns a new instance of KeyNotFoundError.



24
25
26
27
28
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/kv/errors.rb', line 24

def initialize(params={})
  @entry = params[:entry]
  @op = params[:op]
  @message = params[:message]
end

Instance Attribute Details

#entryObject (readonly)

Returns the value of attribute entry.



23
24
25
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/kv/errors.rb', line 23

def entry
  @entry
end

#opObject (readonly)

Returns the value of attribute op.



23
24
25
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/kv/errors.rb', line 23

def op
  @op
end

Instance Method Details

#to_sObject



30
31
32
33
34
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/kv/errors.rb', line 30

def to_s
  msg = "nats: key not found"
  msg = "#{msg}: #{@message}" if @message
  msg
end