Exception: GraphWeaver::ValidationError
- Extended by:
- T::Sig
- Defined in:
- lib/graph_weaver/errors.rb
Overview
Build-time: the query didn't validate against the schema. Carries the structured validation errors (message + line/column) rather than a joined string. Under the Error umbrella like everything else raised here (through 0.1.0 it was an ArgumentError instead).
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
-
#initialize(errors) ⇒ ValidationError
constructor
A new instance of ValidationError.
- #to_h ⇒ Object
Constructor Details
#initialize(errors) ⇒ ValidationError
Returns a new instance of ValidationError.
438 439 440 441 |
# File 'lib/graph_weaver/errors.rb', line 438 def initialize(errors) @errors = errors super("invalid query: #{errors.map { |e| e[:message] }.join("; ")}") end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
435 436 437 |
# File 'lib/graph_weaver/errors.rb', line 435 def errors @errors end |
Instance Method Details
#to_h ⇒ Object
444 445 446 |
# File 'lib/graph_weaver/errors.rb', line 444 def to_h super.merge("errors" => errors.map { |e| e.transform_keys(&:to_s) }) end |