jhpyle / docassemble

A free, open-source expert system for guided interviews and document assembly, based on Python, YAML, and Markdown.
https://docassemble.org
MIT License
786 stars 254 forks source link

Added correct line numbers in errors #688

Closed BryceStevenWilley closed 1 year ago

BryceStevenWilley commented 1 year ago

There is no indication on existing error screens what line of the input YAML file where the error is happening. This, combined with the fact that some error messages have incorrect line numbers, is very confusing for Docassemble users of all skills.

This PR adds the starting line number of the block for all errors. It additionally corrects line numbers for yaml.errors.MarkedYAMLErrors, which are most errors emitted when parsing YAML.

A screenshot of the new error screen: "Error reading YAML file docassemble.playground1efsp:any_filing_interview.yml in the block on line 141. ...  Error was while scanning a simple in "<unicode string>", line 144, column 3: 234987oeun2t3h d;9u efo (line: 144)