Exception: PgEventstore::WrongLockIdError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Error

#as_json, #to_h

Constructor Details

#initialize(set, name, lock_id) ⇒ WrongLockIdError

@param set — subscriptions set name

@param name — subscription's name

@param lock_id

Parameters:

  • set (String)
  • name (String)
  • lock_id (Integer)


300
301
302
303
304
305
# File 'lib/pg_eventstore/errors.rb', line 300

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

Instance Attribute Details

#lock_idInteger

Returns the value of attribute lock_id.

Returns:

  • (Integer)


295
296
297
# File 'lib/pg_eventstore/errors.rb', line 295

def lock_id
  @lock_id
end

#nameString

Returns the value of attribute name.

Returns:

  • (String)


292
293
294
# File 'lib/pg_eventstore/errors.rb', line 292

def name
  @name
end

#setString

Returns the value of attribute set.

Returns:

  • (String)


289
290
291
# File 'lib/pg_eventstore/errors.rb', line 289

def set
  @set
end

Instance Method Details

#user_friendly_messageString

Returns:

  • (String)


308
309
310
311
312
313
# File 'lib/pg_eventstore/errors.rb', line 308

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