Exception: FacturX::SchemaError
- 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
-
#violations ⇒ Object
readonly
Returns the value of attribute violations.
Instance Method Summary collapse
-
#initialize(violations) ⇒ SchemaError
constructor
A new instance of SchemaError.
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
#violations ⇒ Object (readonly)
Returns the value of attribute violations.
31 32 33 |
# File 'lib/factur_x/errors.rb', line 31 def violations @violations end |