Exception: Exwiw::MongoidSchemaGenerator::UnsupportedEmbedding

Inherits:
ArgumentError
  • Object
show all
Defined in:
lib/exwiw/mongoid_schema_generator.rb

Overview

Raised when an embedded collection’s ‘embedded_in` cannot be expressed as an exwiw config (polymorphic embedding, self-referential/cyclic embedding, or an unresolvable embedding-parent class). A subclass of ArgumentError so the historical `raise_error(ArgumentError, …)` contract is preserved. Under `skip_unsupported` the generator rescues this and emits an `ignore: true` config instead of aborting the whole run.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, reason:) ⇒ UnsupportedEmbedding

Returns a new instance of UnsupportedEmbedding.



28
29
30
31
# File 'lib/exwiw/mongoid_schema_generator.rb', line 28

def initialize(message, reason:)
  super(message)
  @reason = reason
end

Instance Attribute Details

#reasonObject (readonly)

A concise phrase (as opposed to the long, actionable exception message) recorded as the generated config’s ‘comment`.



26
27
28
# File 'lib/exwiw/mongoid_schema_generator.rb', line 26

def reason
  @reason
end