Skip to content

Commit 484f832

Browse files
Added handling for non-xml output format
1 parent 2e5f400 commit 484f832

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

pipe/pipe.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,17 @@ def build_report_data(failure_count):
207207

208208
failures = []
209209
if os.path.exists("test-results/phpcs.xml"):
210-
failures = read_failures_from_file(f"test-results/phpcs.xml")
210+
try:
211+
failures = read_failures_from_file(f"test-results/phpcs.xml")
212+
except Exception as e:
213+
self.log_error(f"Failed to parse phpcs.xml: {e}") # log error
214+
try:
215+
with open("test-results/phpcs.xml", 'r') as f:
216+
content = f.read()
217+
self.log_debug(f"phpcs.xml content (first 500 chars): {content[:500]}") # show start of file
218+
except:
219+
pass
220+
raise e
211221

212222
bitbucket_api.create_report(
213223
"Code standards report",

0 commit comments

Comments
 (0)