Exception: PgEventstore::WrongLockIdError

Inherits:
Error
  • Object
show all
Defined in:
lib/pg_eventstore/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Error

#as_json, #to_h

Constructor Details

#initialize(set, name, lock_id) ⇒ WrongLockIdError

Returns a new instance of WrongLockIdError.

Parameters:

  • set (String)

    subscriptions set name

  • name (String)

    subscription’s name

  • lock_id (Integer)


177
178
179
180
181
182
# File 'lib/pg_eventstore/errors.rb', line 177

def initialize(set, name, lock_id)
  @set = set
  @name = name
  @lock_id = lock_id
  super(user_friendly_message)
end

Instance Attribute Details

#lock_idObject

Returns the value of attribute lock_id.



172
173
174
# File 'lib/pg_eventstore/errors.rb', line 172

def lock_id
  @lock_id
end

#nameObject

Returns the value of attribute name.



169
170
171
# File 'lib/pg_eventstore/errors.rb', line 169

def name
  @name
end

#setObject

Returns the value of attribute set.



166
167
168
# File 'lib/pg_eventstore/errors.rb', line 166

def set
  @set
end

Instance Method Details

#user_friendly_messageString

Returns:

  • (String)


185
186
187
188
189
190
# File 'lib/pg_eventstore/errors.rb', line 185

def user_friendly_message
  <<~TEXT.strip
    Could not update subscription from #{set.inspect} set with #{name.inspect} name. It is locked by \
    ##{lock_id.inspect} set suddenly.
  TEXT
end