Open nhjjr opened 8 months ago
This problem happens when any problem occurs in the YAML document. It is probably a good idea to identify common problems and provide our own (more useful) errors, or if that fails capture the problem and report it as a generic "template-error" where --debug
provides more useful information.
@nhjjr : What would you regard as "more useful information"?
The error says exactly what's wrong and where from my POV. I don't know what's vague about it. This:
To suppress this check see: http://yaml.readthedocs.io/en/latest/api.html#duplicate-keys
is admittedly a bit annoying and would be nicer to just swallow, but other than that I don't know how to improve upon
in "/home/niels/code/onyo-demo/.onyo/templates/boardgame", line 2, column 1 found duplicate key "rating" with value "foo" (original value: "bar") in "/home/niels/code/onyo-demo/.onyo/templates/boardgame", line 3, column 1
The error itself is pretty clear, as it uses terminology consistently used in onyo and references the (problematic) file. The main problem is the advice on how to suppress the check. Not only is that impossible within the context of onyo, it would be unclear to someone not familiar with the code or the dependency being used and possibly allude to functionality within the API (that isn't actually there).
I should have been more clear about that.
Ok. Agree on that aspect.
When a template has duplicate keys the resulting error is both vague (to an Onyo user) and refers to documentation from a dependency.
Template:
Output when using
onyo new
: