@@ -9,6 +9,7 @@ import { Logger } from "./logging";
99import {
1010 ActionName ,
1111 createStatusReportBase ,
12+ getActionsStatus ,
1213 sendStatusReport ,
1314 StatusReportBase ,
1415} from "./status-report" ;
@@ -52,6 +53,41 @@ export async function sendSuccessStatusReport(
5253 }
5354}
5455
56+ /**
57+ * Sends a status report for the `start-proxy` action indicating a failure.
58+ *
59+ * @param logger The logger to use.
60+ * @param startedAt When the action was started.
61+ * @param language The language provided as input, if any.
62+ * @param unwrappedError The exception that was thrown.
63+ */
64+ export async function sendFailedStatusReport (
65+ logger : Logger ,
66+ startedAt : Date ,
67+ language : KnownLanguage | undefined ,
68+ unwrappedError : unknown ,
69+ ) {
70+ const error = util . wrapError ( unwrappedError ) ;
71+ core . setFailed ( `start-proxy action failed: ${ error . message } ` ) ;
72+
73+ // We skip sending the error message and stack trace here to avoid the possibility
74+ // of leaking any sensitive information into the telemetry.
75+ const errorStatusReportBase = await createStatusReportBase (
76+ ActionName . StartProxy ,
77+ getActionsStatus ( error ) ,
78+ startedAt ,
79+ {
80+ languages : language && [ language ] ,
81+ } ,
82+ await util . checkDiskUsage ( logger ) ,
83+ logger ,
84+ "Error from start-proxy Action omitted" ,
85+ ) ;
86+ if ( errorStatusReportBase !== undefined ) {
87+ await sendStatusReport ( errorStatusReportBase ) ;
88+ }
89+ }
90+
5591export const UPDATEJOB_PROXY = "update-job-proxy" ;
5692export const UPDATEJOB_PROXY_VERSION = "v2.0.20250624110901" ;
5793const UPDATEJOB_PROXY_URL_PREFIX =
0 commit comments