Class: NATS::KeyValue::KeyNotFoundError

Inherits:
Error
  • Object
show all
Defined in:
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



26
27
28
29
30
# File 'lib/nats/io/kv/errors.rb', line 26

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

Instance Attribute Details

#entryObject (readonly)

Returns the value of attribute entry.



25
26
27
# File 'lib/nats/io/kv/errors.rb', line 25

def entry
  @entry
end

#opObject (readonly)

Returns the value of attribute op.



25
26
27
# File 'lib/nats/io/kv/errors.rb', line 25

def op
  @op
end

Instance Method Details

#to_sObject



32
33
34
35
36
# File 'lib/nats/io/kv/errors.rb', line 32

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