Use getErrorMessage in more places

This commit is contained in:
Henry Mercer
2026-01-23 10:36:25 +00:00
parent 6bd84b6a82
commit 529c266223
9 changed files with 45 additions and 27 deletions
+5 -3
View File
@@ -321,7 +321,9 @@ export async function createStatusReportBase(
try {
statusReport.actions_event_name = getWorkflowEventName();
} catch (e) {
logger.warning(`Could not determine the workflow event name: ${e}.`);
logger.warning(
`Could not determine the workflow event name: ${getErrorMessage(e)}.`,
);
}
if (config) {
@@ -374,7 +376,7 @@ export async function createStatusReportBase(
return statusReport;
} catch (e) {
logger.warning(
`Caught an exception while gathering information for telemetry: ${e}. Will skip sending status report.`,
`Failed to gather information for telemetry: ${getErrorMessage(e)}. Will skip sending status report.`,
);
// Re-throw the exception in test mode. While testing, we want to know if something goes wrong here.
@@ -629,7 +631,7 @@ export async function sendUnhandledErrorStatusReport(
}
} catch (e) {
logger.warning(
`Caught an exception while sending the error status report: ${e}.`,
`Failed to send the error status report: ${getErrorMessage(e)}.`,
);
}
}