Module: Synthra::Errors

Defined in:
lib/synthra/errors.rb

Overview

Container module for all Synthra error classes

This module provides a namespace for error organization. All errors are also aliased at the Synthra module level for convenience.

Examples:

Catching any Synthra error

begin
  schema.generate
rescue Synthra::Error => e
  puts "Synthra error: #{e.message}"
end

Catching specific error types

begin
  registry.load_file("schema.dsl")
rescue Synthra::ParseError => e
  puts "Parse error at line #{e.line}: #{e.message}"
rescue Synthra::GenerationError => e
  puts "Generation error: #{e.message}"
end

Defined Under Namespace

Classes: ApiError, ArraySizeLimitError, ConditionError, ContextError, CycleError, CyclicReferenceError, Error, FieldOrderError, GenerationError, IndentationError, InvalidProbabilityError, LatencyLimitError, MissingFunctionError, MissingReferenceError, MixinError, ParseError, PathError, RecursionLimitError, ReferenceError, ResourceLimitError, ScenarioError, SchemaError, SecurityError, SimulatedBehaviorError, SimulatedConnectionDrop, SimulatedError, SimulatedFailure, SyntaxError, TextLengthLimitError, TypeError, UniquenessError, UnknownTypeError, ValidationError

Instance Attribute Summary collapse

Instance Attribute Details

#columnInteger? (readonly)

Returns the column number where the error occurred (1-based).

Returns:

  • (Integer, nil)

    the column number where the error occurred (1-based)



# File 'lib/synthra/errors.rb', line 77

#lineInteger? (readonly)

Returns the line number where the error occurred (1-based).

Returns:

  • (Integer, nil)

    the line number where the error occurred (1-based)



# File 'lib/synthra/errors.rb', line 77

#source_contextArray<String>? (readonly)

Returns lines before/after for context.

Returns:

  • (Array<String>, nil)

    lines before/after for context



# File 'lib/synthra/errors.rb', line 77

#source_lineString? (readonly)

Returns the content of the source line with the error.

Returns:

  • (String, nil)

    the content of the source line with the error



# File 'lib/synthra/errors.rb', line 77

#suggestionsArray<String>? (readonly)

Returns "did you mean" suggestions.

Returns:

  • (Array<String>, nil)

    "did you mean" suggestions



# File 'lib/synthra/errors.rb', line 77