Add UserError

This commit adds a `UserError` class that should be thrown when the
cause of an error is fundamentally from user configuration.

When sending status reports, avoid sending a `failure` for `UserError`s.
This will prevent our diagnostics from pinging us for errors outside of
our control.
This commit is contained in:
Andrew Eisenberg 2022-02-17 11:47:04 -08:00
parent 040feefecf
commit 3d93bb2ac9
21 changed files with 96 additions and 34 deletions

View file

@ -59,7 +59,7 @@ async function run() {
const stack = error instanceof Error ? error.stack : String(error);
core.setFailed(message);
console.log(error);
await actionsUtil.sendStatusReport(await actionsUtil.createStatusReportBase("upload-sarif", "failure", startedAt, message, stack));
await actionsUtil.sendStatusReport(await actionsUtil.createStatusReportBase("upload-sarif", actionsUtil.getActionsStatus(error), startedAt, message, stack));
return;
}
}