Skip to content

Commit 9cd36a0

Browse files
committed
catch and explain invalid input object
1 parent 1b391e4 commit 9cd36a0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cwltool/main.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ def load_job_order(args, # type: argparse.Namespace
229229
): # type: (...) -> Tuple[MutableMapping[Text, Any], Text, Loader]
230230

231231
job_order_object = None
232+
job_order_file = None
232233

233234
_jobloaderctx = jobloaderctx.copy()
234235
loader = Loader(_jobloaderctx, fetcher_constructor=fetcher_constructor) # type: ignore
@@ -256,6 +257,13 @@ def load_job_order(args, # type: argparse.Namespace
256257
if not job_order_object:
257258
input_basedir = args.basedir if args.basedir else os.getcwd()
258259

260+
if job_order_object and not isinstance(job_order_object, MutableMapping):
261+
_logger.error(
262+
'CWL input object at %s is not formatted correctly, it should be a '
263+
'JSON/YAML dictionay, not %s.\n'
264+
'Raw input object:\n%s', job_order_file or "stdin",
265+
type(job_order_object), job_order_object)
266+
sys.exit(1)
259267
return (job_order_object, input_basedir, loader)
260268

261269

0 commit comments

Comments
 (0)