Exception: PgEventstore::SubscriptionAlreadyLockedError

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

Returns a new instance of SubscriptionAlreadyLockedError.

Parameters:

  • set (String)

    subscriptions set name

  • name (String)

    subscription’s name

  • lock_id (Integer)


147
148
149
150
151
152
# File 'lib/pg_eventstore/errors.rb', line 147

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.



142
143
144
# File 'lib/pg_eventstore/errors.rb', line 142

def lock_id
  @lock_id
end

#nameObject

Returns the value of attribute name.



139
140
141
# File 'lib/pg_eventstore/errors.rb', line 139

def name
  @name
end

#setObject

Returns the value of attribute set.



136
137
138
# File 'lib/pg_eventstore/errors.rb', line 136

def set
  @set
end

Instance Method Details

#user_friendly_messageString

Returns:

  • (String)


155
156
157
158
159
160
# File 'lib/pg_eventstore/errors.rb', line 155

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