Skip to content

Commit 714eab7

Browse files
authored
Merge pull request #103 from PMCC-BioinformaticsCore/add-fromwdl-line-catcher
Add exception handling to fromwdl
2 parents 2433543 + a08f4c2 commit 714eab7

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

janis_core/ingestion/fromwdl.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import os
44
import re
55
from types import LambdaType
6+
67
from typing import List, Union, Optional, Callable
78
import WDL
89

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

448449
toolname = sys.argv[1]
449450

450-
tool = WdlParser.from_doc(toolname)
451-
452-
tool.translate("janis")
451+
try:
452+
tool = WdlParser.from_doc(toolname)
453+
tool.translate("janis")
454+
455+
except WDL.Error.MultipleValidationErrors as err:
456+
for exc in err.exceptions:
457+
print(exc, file=sys.stderr)
458+
print(exc.pos, file=sys.stderr)
459+
print(exc.node, file=sys.stderr)
460+
except WDL.Error.ValidationError as exc:
461+
print(exc, file=sys.stderr)
462+
print(exc.pos, file=sys.stderr)
463+
print(exc.node, file=sys.stderr)

0 commit comments

Comments
 (0)