common-workflow-lab/wdl-cwl-translator

Make use of the "pos" attribute on MiniWDL objects for better error messages

mr-c opened this issue · 0 comments

mr-c commented

The pos attribute is of type SourcePosition.

Example:

SourcePosition(uri='wdl_files/whatshap-Phase.wdl', abspath='/home/michael/wdl2cwl/wdl2cwl/tests/wdl_files/whatshap-Phase.wdl', line=54, column=54, end_line=54, end_column=57)

In schema-salad using CWL project we have a similar attribute via our use of ruamel.yaml that we using with our SourceLine objects to automatically wrap exceptions with details on the item and location in the original file: https://github.com/common-workflow-language/schema_salad/blob/661fb0fa8c745ed70253dda93bd12002007f6b33/schema_salad/sourceline.py#L232

For internal miniwdl use, they have something similar multi_context between only trapping WDL.Error.{ValidationError,MultipleValidationErrors} and its usage model means that I don't feel it makes sense for our needs in wdl2cwl