Exception: Sequent::Core::AggregateKeyNotUniqueError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- Sequent::Core::AggregateKeyNotUniqueError
- Defined in:
- lib/sequent/core/event_store.rb
Instance Attribute Summary collapse
-
#aggregate_id ⇒ Object
readonly
Returns the value of attribute aggregate_id.
-
#aggregate_type ⇒ Object
readonly
Returns the value of attribute aggregate_type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(message) ⇒ AggregateKeyNotUniqueError
constructor
A new instance of AggregateKeyNotUniqueError.
Constructor Details
#initialize(message) ⇒ AggregateKeyNotUniqueError
Returns a new instance of AggregateKeyNotUniqueError.
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/sequent/core/event_store.rb', line 19 def initialize() super match = .match( # rubocop:disable Layout/LineLength /aggregate (\p{Upper}\p{Alnum}*(?:::\p{Upper}\p{Alnum}*)*) (\p{XDigit}{8}-\p{XDigit}{4}-\p{XDigit}{4}-\p{XDigit}{4}-\p{XDigit}{12})/, # rubocop:enable Layout/LineLength ) if match @aggregate_type = match[1] @aggregate_id = match[2] end end |
Instance Attribute Details
#aggregate_id ⇒ Object (readonly)
Returns the value of attribute aggregate_id.
13 14 15 |
# File 'lib/sequent/core/event_store.rb', line 13 def aggregate_id @aggregate_id end |
#aggregate_type ⇒ Object (readonly)
Returns the value of attribute aggregate_type.
13 14 15 |
# File 'lib/sequent/core/event_store.rb', line 13 def aggregate_type @aggregate_type end |
Class Method Details
.unique_key_error_message?(message) ⇒ Boolean
15 16 17 |
# File 'lib/sequent/core/event_store.rb', line 15 def self.() =~ /duplicate unique key value for aggregate/ end |