Unify error messages in getFileType

This commit is contained in:
Michael B. Gale 2024-04-12 13:22:28 +01:00
parent 4b0172d9c2
commit 3901d1208a
No known key found for this signature in database
GPG key ID: FF5E2765BD00628F
3 changed files with 3 additions and 7 deletions

View file

@ -447,11 +447,8 @@ export const getFileType = async (filePath: string): Promise<string> => {
try {
fileCmdPath = await safeWhich.safeWhich("file");
} catch (e) {
core.info(
"The `file` program is required, but does not appear to be installed. Please install it.",
);
throw new FileCmdNotFoundError(
`The \`file\` program is not installed: ${e}`,
`The \`file\` program is required, but does not appear to be installed. Please install it: ${e}`,
);
}