Commit 19335a45 authored by canterburym's avatar canterburym
Browse files

Fixing crash in linter when ASN.1 doesn't parse

parent f792937e
Pipeline #2567 passed with stage
in 1 minute and 15 seconds
......@@ -39,7 +39,7 @@ def lintingTest (testName, testKind, testDescription):
def formatFailure(f):
return f"{f['testName']}: {f['message']}"
return f"{f['testName'] if f.get('testName') else 'Failure'}: {f['message']}"
def appendFailure(failures, context, newFailure):
......@@ -186,8 +186,8 @@ def lintASN1File (asnFile):
for test in typeLevelTests:
errors += test(typeDef, context)
except ParseError as ex:
appendFailure(errors, context, { "message" : "ParseError: {0}".format(ex)})
logging.error("ParseError: {0}".format(ex))
return ["ParseError: {0}".format(ex)]
return errors
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment