common-workflow-language / schema_salad

Semantic Annotations for Linked Avro Data
https://www.commonwl.org/v1.2/SchemaSalad.html
Apache License 2.0
72 stars 62 forks source link

Counter-intuitive error message when parsing an empty file #681

Open GlassOfWhiskey opened 1 year ago

GlassOfWhiskey commented 1 year ago

If Schema SALAD resolve_ref method is used to parse an empty file, the returned error message is counter-intuitive.

mr-c commented 1 year ago
novice-tutorial-exercises$ touch workflow_input_3.yml
novice-tutorial-exercises$ cwltool rna_seq_workflow_2.cwl workflow_input_3.yml
INFO /home/michael/cwltool/env3.11/bin/cwltool 3.1
INFO Resolved 'rna_seq_workflow_2.cwl' to 'file:///home/michael/src/2022-12-06-clum-cwl-tutorial/novice-tutorial-exercises/rna_seq_workflow_2.cwl'
ERROR I'm sorry, I couldn't load this CWL file, try again with --debug for more information.
The error was: 

(that's the error, nothing!)

novice-tutorial-exercises$ cwltool --debug rna_seq_workflow_2.cwl workflow_input_3.yml
INFO /home/michael/cwltool/env3.11/bin/cwltool 3.1
INFO Resolved 'rna_seq_workflow_2.cwl' to 'file:///home/michael/src/2022-12-06-clum-cwl-tutorial/novice-tutorial-exercises/rna_seq_workflow_2.cwl'
ERROR I'm sorry, I couldn't load this CWL file.
The error was: 
Traceback (most recent call last):
  File "/home/michael/cwltool/cwltool/main.py", line 1066, in main
    job_order_object, input_basedir, jobloader = load_job_order(
                                                 ^^^^^^^^^^^^^^^
  File "/home/michael/cwltool/cwltool/main.py", line 368, in load_job_order
    job_order_object, _ = loader.resolve_ref(
                          ^^^^^^^^^^^^^^^^^^^
  File "schema_salad/ref_resolver.py", line 531, in resolve_ref
  File "schema_salad/ref_resolver.py", line 993, in fetch
StopIteration