Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Commit ba92988

Browse files
committed
Fixed (I think) small but problematic lack of error handling in the jod doc task for when it tries to extract supported doc types.
1 parent f1811c4 commit ba92988

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Jobs/tasks/tasks.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -753,8 +753,12 @@ def applyPythonScriptToJobDoc(*args, docId=-1, jobId=-1, nodeId=-1, scriptId=-1,
753753
logger.info(f"Retrieved node: {node_result}")
754754

755755
# Check that the input files are compatible with scripts:
756-
supported_doc_types = json.loads(pipeline_node.script.supported_file_types)
757-
logger.info(f"Supported doc types: {supported_doc_types}")
756+
supported_doc_types = {}
757+
try:
758+
supported_doc_types = json.loads(pipeline_node.script.supported_file_types)
759+
logger.info(f"Supported doc types: {supported_doc_types}")
760+
except:
761+
pass
758762

759763
if supported_doc_types and not doc.type in supported_doc_types:
760764
logger.info(f"Doc type {doc.type} is NOT one of supported types: {supported_doc_types}")
@@ -767,7 +771,7 @@ def applyPythonScriptToJobDoc(*args, docId=-1, jobId=-1, nodeId=-1, scriptId=-1,
767771
))
768772

769773
else:
770-
logger.info("Doc type is supported!")
774+
logger.info("Doc type is supported or no restrictions in place.")
771775
jobLog.write("\nDoc type {0} IS supported by script ID #{1}".format(
772776
doc.type,
773777
scriptId

0 commit comments

Comments
 (0)