Consistently wrap errors

This commit is contained in:
Henry Mercer 2023-04-06 17:04:21 +01:00
parent 555b602b2f
commit e5c2f32a9f
39 changed files with 145 additions and 122 deletions

View file

@ -34,9 +34,10 @@ const uploadLib = __importStar(require("./upload-lib"));
const util_1 = require("./util");
const workflow_1 = require("./workflow");
function createFailedUploadFailedSarifResult(error) {
const wrappedError = (0, util_1.wrapError)(error);
return {
upload_failed_run_error: error instanceof Error ? error.message : String(error),
upload_failed_run_stack_trace: error instanceof Error ? error.stack : undefined,
upload_failed_run_error: wrappedError.message,
upload_failed_run_stack_trace: wrappedError.stack,
};
}
/**