Correctly extract parse errors from build reports

This commit is contained in:
Jonathan Coates 2021-07-18 16:17:11 +01:00
parent ee96458b56
commit 74752c561c
No known key found for this signature in database
GPG Key ID: B9E431FF07C98D06
1 changed files with 7 additions and 0 deletions

View File

@ -14,6 +14,7 @@ import os.path
LUA_ERROR_LOCATION = re.compile(r"^\s+(/[\w./-]+):(\d+):", re.MULTILINE)
JAVA_LUA_ERROR_LOCATION = re.compile(r"^java.lang.IllegalStateException: (/[\w./-]+):(\d+):")
JAVA_ERROR_LOCATION = re.compile(r"^\tat ([\w.]+)\.[\w]+\([\w.]+:(\d+)\)$", re.MULTILINE)
ERROR_MESSAGE = re.compile(r"(.*)\nstack traceback:", re.DOTALL)
@ -46,6 +47,12 @@ def find_location(message: str) -> Optional[Tuple[str, str]]:
if file:
return file, location[2]
location = JAVA_LUA_ERROR_LOCATION.search(message)
if location:
file = find_file(location[1])
if file:
return file, location[2]
for location in JAVA_ERROR_LOCATION.findall(message):
file = find_file(location[0].replace(".", "/") + ".java")
if file: