Throw if in test mode

This commit is contained in:
Henry Mercer
2026-01-23 10:40:51 +00:00
parent edebb7861e
commit 91f3460006
9 changed files with 63 additions and 0 deletions

View File

@@ -630,10 +630,17 @@ export async function sendUnhandledErrorStatusReport(
);
if (statusReport !== undefined) {
await sendStatusReport(statusReport);
} else if (isInTestMode()) {
throw new Error(
"Failed to create status report for unhandled error in test mode.",
);
}
} catch (e) {
logger.warning(
`Failed to send the error status report: ${getErrorMessage(e)}.`,
);
if (isInTestMode()) {
throw e;
}
}
}