lutaml / lutaml-uml

UML module for LutaML
2 stars 2 forks source link

If YAML input is malformed, need to tell user which YAML file broke #69

Closed opoudjis closed 3 years ago

opoudjis commented 3 years ago

See e.g. https://github.com/metanorma/metanorma-model-standoc/runs/2077277767

lutaml -t png -o images/StandardDoc_Sections.png views/StandardDoc_Sections.lutaml
/Users/runner/hostedtoolcache/Ruby/2.6.6/x64/lib/ruby/gems/2.6.0/gems/parslet-1.7.1/lib/parslet/cause.rb:70:in `raise': Failed to match sequence (WHITESPACE? DIAGRAM_DEFINITION) at line 1 char 1. (Parslet::ParseFailed)
    from /Users/runner/hostedtoolcache/Ruby/2.6.6/x64/lib/ruby/gems/2.6.0/gems/parslet-1.7.1/lib/parslet/atoms/base.rb:49:in `parse'
    from /Users/runner/hostedtoolcache/Ruby/2.6.6/x64/lib/ruby/gems/2.6.0/gems/lutaml-uml-0.2.9/lib/lutaml/uml/parsers/dsl.rb:23:in `parse'
    from /Users/runner/hostedtoolcache/Ruby/2.6.6/x64/lib/ruby/gems/2.6.0/gems/lutaml-uml-0.2.9/lib/lutaml/uml/parsers/dsl.rb:18:in `parse'
    from /Users/runner/hostedtoolcache/Ruby/2.6.6/x64/lib/ruby/gems/2.6.0/gems/lutaml-0.4.1/lib/lutaml/parser.rb:39:in `block in parse_into_document'
    from /Users/runner/hostedtoolcache/Ruby/2.6.6/x64/lib/ruby/gems/2.6.0/gems/lutaml-0.4.1/lib/lutaml/parser.rb:39:in `map'
    from /Users/runner/hostedtoolcache/Ruby/2.6.6/x64/lib/ruby/gems/2.6.0/gems/lutaml-0.4.1/lib/lutaml/parser.rb:39:in `parse_into_document'
    from /Users/runner/hostedtoolcache/Ruby/2.6.6/x64/lib/ruby/gems/2.6.0/gems/lutaml-0.4.1/lib/lutaml/parser.rb:18:in `parse_into_document'
    from /Users/runner/hostedtoolcache/Ruby/2.6.6/x64/lib/ruby/gems/2.6.0/gems/lutaml-0.4.1/lib/lutaml/command_line.rb:90:in `block in run'
    from /Users/runner/hostedtoolcache/Ruby/2.6.6/x64/lib/ruby/gems/2.6.0/gems/lutaml-0.4.1/lib/lutaml/command_line.rb:83:in `each'
    from /Users/runner/hostedtoolcache/Ruby/2.6.6/x64/lib/ruby/gems/2.6.0/gems/lutaml-0.4.1/lib/lutaml/command_line.rb:83:in `run'
    from /Users/runner/hostedtoolcache/Ruby/2.6.6/x64/lib/ruby/gems/2.6.0/gems/lutaml-0.4.1/lib/lutaml/command_line.rb:21:in `run'
    from /Users/runner/hostedtoolcache/Ruby/2.6.6/x64/lib/ruby/gems/2.6.0/gems/lutaml-0.4.1/exe/lutaml:22:in `<top (required)>'
    from /Users/runner/hostedtoolcache/Ruby/2.6.6/x64/bin/lutaml:23:in `load'
    from /Users/runner/hostedtoolcache/Ruby/2.6.6/x64/bin/lutaml:23:in `<main>'
make: *** [images/StandardDoc_Sections.png] Error 1

There is obviously a syntax error, but the user has no idea which YAML file included in views/StandardDoc_Sections.lutaml is triggering it.

w00lf commented 3 years ago

@opoudjis @ronaldtse Duplicate of https://github.com/lutaml/lutaml-uml/issues/71, fixed in https://github.com/lutaml/lutaml-uml/pull/89