mirror of
				https://github.com/SquidDev-CC/CC-Tweaked
				synced 2025-10-31 13:42:59 +00:00 
			
		
		
		
	Correctly extract parse errors from build reports
This commit is contained in:
		| @@ -14,6 +14,7 @@ import os.path | |||||||
|  |  | ||||||
|  |  | ||||||
| LUA_ERROR_LOCATION = re.compile(r"^\s+(/[\w./-]+):(\d+):", re.MULTILINE) | 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) | JAVA_ERROR_LOCATION = re.compile(r"^\tat ([\w.]+)\.[\w]+\([\w.]+:(\d+)\)$", re.MULTILINE) | ||||||
| ERROR_MESSAGE = re.compile(r"(.*)\nstack traceback:", re.DOTALL) | ERROR_MESSAGE = re.compile(r"(.*)\nstack traceback:", re.DOTALL) | ||||||
|  |  | ||||||
| @@ -46,6 +47,12 @@ def find_location(message: str) -> Optional[Tuple[str, str]]: | |||||||
|         if file: |         if file: | ||||||
|             return file, location[2] |             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): |     for location in JAVA_ERROR_LOCATION.findall(message): | ||||||
|         file = find_file(location[0].replace(".", "/") + ".java") |         file = find_file(location[0].replace(".", "/") + ".java") | ||||||
|         if file: |         if file: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Jonathan Coates
					Jonathan Coates