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

@ -25,6 +25,7 @@ import {
getTrapCachingExtractorConfigArgsForLang,
} from "./trap-caching";
import * as util from "./util";
import { wrapError } from "./util";
type Options = Array<string | number | boolean>;
@ -377,7 +378,7 @@ export async function setupCodeQL(
toolsVersion,
};
} catch (e) {
logger.error(e instanceof Error ? e : new Error(String(e)));
logger.error(wrapError(e).message);
throw new Error("Unable to download and extract CodeQL CLI");
}
}