Exception: Synthra::Errors::MissingReferenceError
- Inherits:
-
GenerationError
- Object
- StandardError
- Error
- GenerationError
- Synthra::Errors::MissingReferenceError
- Defined in:
- lib/synthra/errors.rb
Overview
Referenced schema or field not found
Raised when a Ref() references a schema or field that doesn't exist.
Constant Summary collapse
- ERROR_CODE =
"MISSING_REFERENCE_ERROR"
Instance Attribute Summary collapse
-
#field_path ⇒ String?
readonly
The field path within the schema (if applicable).
-
#schema_name ⇒ String
readonly
The schema name that was referenced.
Instance Method Summary collapse
-
#initialize(schema_name:, field_path: nil) ⇒ MissingReferenceError
constructor
Create a new MissingReferenceError.
Constructor Details
#initialize(schema_name:, field_path: nil) ⇒ MissingReferenceError
Create a new MissingReferenceError
710 711 712 713 714 715 716 717 718 719 720 |
# File 'lib/synthra/errors.rb', line 710 def initialize(schema_name:, field_path: nil) @schema_name = schema_name @field_path = field_path = if field_path "Reference not found: #{schema_name}.#{field_path}" else "Schema not found: #{schema_name}" end super() end |
Instance Attribute Details
#field_path ⇒ String? (readonly)
Returns the field path within the schema (if applicable).
699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 |
# File 'lib/synthra/errors.rb', line 699 class MissingReferenceError < GenerationError ERROR_CODE = "MISSING_REFERENCE_ERROR" attr_reader :schema_name, :field_path # Create a new MissingReferenceError # # @param schema_name [String] the schema name that wasn't found # @param field_path [String, nil] the field path if referencing a specific field # def initialize(schema_name:, field_path: nil) @schema_name = schema_name @field_path = field_path = if field_path "Reference not found: #{schema_name}.#{field_path}" else "Schema not found: #{schema_name}" end super() end end |
#schema_name ⇒ String (readonly)
Returns the schema name that was referenced.
699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 |
# File 'lib/synthra/errors.rb', line 699 class MissingReferenceError < GenerationError ERROR_CODE = "MISSING_REFERENCE_ERROR" attr_reader :schema_name, :field_path # Create a new MissingReferenceError # # @param schema_name [String] the schema name that wasn't found # @param field_path [String, nil] the field path if referencing a specific field # def initialize(schema_name:, field_path: nil) @schema_name = schema_name @field_path = field_path = if field_path "Reference not found: #{schema_name}.#{field_path}" else "Schema not found: #{schema_name}" end super() end end |