Handle errors when stringifying errors in uploads (#1008)
Should hopefully fix a failed publication at https://github.com/bytecodealliance/wasmtime/runs/471153746. I really am truly bad at JS.
This commit is contained in:
17
.github/actions/github-release/main.js
vendored
17
.github/actions/github-release/main.js
vendored
@@ -94,17 +94,24 @@ async function run() {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (i === retries - 1)
|
if (i === retries - 1)
|
||||||
throw e;
|
throw e;
|
||||||
console.log("ERROR: ", JSON.stringify(e, null, 2));
|
logError(e);
|
||||||
console.log("ERROR: ", e.message);
|
|
||||||
console.log(e.stack);
|
|
||||||
console.log("RETRYING after 10s");
|
console.log("RETRYING after 10s");
|
||||||
await sleep(10000)
|
await sleep(10000)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function logError(e) {
|
||||||
|
console.log("ERROR: ", e.message);
|
||||||
|
try {
|
||||||
|
console.log(JSON.stringify(e, null, 2));
|
||||||
|
} catch (e) {
|
||||||
|
// ignore json errors for now
|
||||||
|
}
|
||||||
|
console.log(e.stack);
|
||||||
|
}
|
||||||
|
|
||||||
run().catch(err => {
|
run().catch(err => {
|
||||||
console.log("ERROR: ", JSON.stringify(err, null, 2));
|
logError(err);
|
||||||
core.setFailed(err.message);
|
core.setFailed(err.message);
|
||||||
console.log(err.stack);
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user