diff --git a/backend/apps/ifc_validation/tasks.py b/backend/apps/ifc_validation/tasks.py index efff6e5..462c465 100644 --- a/backend/apps/ifc_validation/tasks.py +++ b/backend/apps/ifc_validation/tasks.py @@ -568,7 +568,15 @@ def schema_validation_subtask(self, prev_result, id, file_name, *args, **kwargs) task.mark_as_failed(err) raise - output = list(filter(None, proc.stdout.split("\n"))) + # schema check returns either multiple JSON lines, or a single line message, or nothing. + def is_schema_error(line): + try: + json.loads(line) # ignoring non-JSON messages + except ValueError: + return False + return True + + output = list(filter(is_schema_error, proc.stdout.split("\n"))) # success = (len(output) == 0) # tfk: if we mark this task as failed we don't do the instance population either. # marking as failed should probably be reserved for blocking errors (prerequisites)