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

3
lib/actions-util.js generated
View file

@ -399,8 +399,7 @@ const getFileType = async (filePath) => {
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}`);
throw new FileCmdNotFoundError(`The \`file\` program is required, but does not appear to be installed. Please install it: ${e}`);
}
try {
// The `file` command will output information about the type of file pointed at by `filePath`.

File diff suppressed because one or more lines are too long

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}`,
);
}