Exception: FacturX::SchemaError

Inherits:
Error
  • Object
show all
Defined in:
lib/factur_x/errors.rb

Overview

Raised when the generated document does not conform to the Factur-X XSD. This signals a bug in the gem rather than bad input.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(violations) ⇒ SchemaError

Returns a new instance of SchemaError.



33
34
35
36
37
# File 'lib/factur_x/errors.rb', line 33

def initialize(violations)
  @violations = Array(violations)
  details = @violations.map { |violation| "  - #{violation}" }.join("\n")
  super("generated XML does not conform to the Factur-X EN 16931 schema:\n#{details}")
end

Instance Attribute Details

#violationsObject (readonly)

Returns the value of attribute violations.



31
32
33
# File 'lib/factur_x/errors.rb', line 31

def violations
  @violations
end