Skip to content

Commit

Permalink
Merge pull request #103 from PMCC-BioinformaticsCore/add-fromwdl-line…
Browse files Browse the repository at this point in the history
…-catcher

Add exception handling to fromwdl
  • Loading branch information
illusional authored Sep 1, 2021
2 parents 2433543 + a08f4c2 commit 714eab7
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions janis_core/ingestion/fromwdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
import re
from types import LambdaType

from typing import List, Union, Optional, Callable
import WDL

Expand Down Expand Up @@ -447,6 +448,16 @@ def parse_command_tool_output(self, outp: WDL.Decl):

toolname = sys.argv[1]

tool = WdlParser.from_doc(toolname)

tool.translate("janis")
try:
tool = WdlParser.from_doc(toolname)
tool.translate("janis")

except WDL.Error.MultipleValidationErrors as err:
for exc in err.exceptions:
print(exc, file=sys.stderr)
print(exc.pos, file=sys.stderr)
print(exc.node, file=sys.stderr)
except WDL.Error.ValidationError as exc:
print(exc, file=sys.stderr)
print(exc.pos, file=sys.stderr)
print(exc.node, file=sys.stderr)

0 comments on commit 714eab7

Please sign in to comment.