Exception: GraphWeaver::ValidationError
- 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.
313 314 315 316 |
# File 'lib/graph_weaver/errors.rb', line 313 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.
311 312 313 |
# File 'lib/graph_weaver/errors.rb', line 311 def errors @errors end |
Instance Method Details
#to_h ⇒ Object
318 319 320 |
# File 'lib/graph_weaver/errors.rb', line 318 def to_h super.merge("errors" => errors.map { |e| e.transform_keys(&:to_s) }) end |