Skip to content

Commit

Permalink
IVS-13 clearer message for critical error
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghesselink committed Jun 14, 2024
1 parent 994bb91 commit 55e426d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions backend/apps/ifc_validation_bff/views_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,15 +406,14 @@ def report(request, id: str):
task = ValidationTask.objects.filter(request_id=request.id, type=ValidationTask.Type.SYNTAX).last()
if task.outcomes:
for outcome in task.outcomes.iterator():

# TODO - should we not do this in the model?
match = re.search('^On line ([0-9])+ column ([0-9])+(.)*', outcome.observed)
mapped = {
"id": outcome.public_id,
"lineno": match.groups()[0] if match and len(match.groups()) > 0 else None,
"column": match.groups()[1] if match and len(match.groups()) > 1 else None,
"severity": outcome.severity,
"msg": outcome.observed,
"msg": f"expected: {outcome.expected}, observed: {outcome.observed}" if getattr(outcome, 'expected', None) is not None else outcome.observed,
"task_id": outcome.validation_task_public_id
}
syntax_results.append(mapped)
Expand Down

0 comments on commit 55e426d

Please sign in to comment.