[ci] More info to test annotation failure logging (#215515)

## Summary
While annotating test failures, we're seeing increased amount of errors
like this:
```
2025-03-21 13:52:32 INFO   Artifact uploads completed successfully
--
  | Annotate test failures error Request failed with status code 404
  | HTTP Error Response Status 404
  | HTTP Error Response Body { message: 'Not Found' }
  | user command error: exit status 10
```

It would be nicer to show a bit more from the error to help debugging.
This commit is contained in:
Alex Szabo 2025-03-24 19:01:32 +01:00 committed by GitHub
parent dea190c0ef
commit 7120074ec3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -13,10 +13,17 @@ import { TestFailures } from '#pipeline-utils';
try {
await TestFailures.annotateTestFailures();
} catch (ex) {
console.error('Annotate test failures error', ex.message);
console.error(
'Annotate test failures error',
ex.message,
ex?.stack || 'no stacktrace information'
);
if (ex.response) {
console.error('HTTP Error Response Status', ex.response.status);
console.error('HTTP Error Response Body', ex.response.data);
const requestUrl = ex.response?.url || ex.response?.config?.url || '';
console.error(
`HTTP Error ${ex.response.status}/${ex.response.statusText} (${requestUrl})`,
ex.response.data
);
}
process.exit(1);
}