raise ApiError when isExecutable tag is missing.

Unsure how this would actually happen, since it should get set to False if box is unchecked.
This commit is contained in:
mike cullerton 2022-02-21 10:17:01 -05:00
parent 65e62a72e1
commit a830657ebd
1 changed files with 7 additions and 0 deletions

View File

@ -113,6 +113,13 @@ class SpecFileService(FileSystemService):
except etree.XMLSyntaxError as xse:
raise ApiError("invalid_xml", "Failed to parse xml: " + str(xse), file_name=file_name)
except ValidationException as ve:
if ve.args[0].find('No executable process tag found') >= 0:
raise ApiError(code='missing_executable_option',
message='No executable process tag found. Please make sure the Executable option is set in the workflow.')
else:
raise ApiError(code='validation_error',
message=f'There was an error validating your workflow. Original message is: {ve}')
else:
raise ApiError("invalid_xml", "Only a BPMN can be the primary file.", file_name=file_name)