Exception: PgEventstore::SubscriptionAlreadyLockedError

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) ⇒ SubscriptionAlreadyLockedError

@param set — subscriptions set name

@param name — subscription's name

@param lock_id

Parameters:

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


270
271
272
273
274
275
# File 'lib/pg_eventstore/errors.rb', line 270

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)


265
266
267
# File 'lib/pg_eventstore/errors.rb', line 265

def lock_id
  @lock_id
end

#nameString

Returns the value of attribute name.

Returns:

  • (String)


262
263
264
# File 'lib/pg_eventstore/errors.rb', line 262

def name
  @name
end

#setString

Returns the value of attribute set.

Returns:

  • (String)


259
260
261
# File 'lib/pg_eventstore/errors.rb', line 259

def set
  @set
end

Instance Method Details

#user_friendly_messageString

Returns:

  • (String)


278
279
280
281
282
283
# File 'lib/pg_eventstore/errors.rb', line 278

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