better error

This commit is contained in:
Abhinav 2023-01-30 18:59:33 +05:30
parent b32aece47f
commit fdef4b8482
2 changed files with 3 additions and 5 deletions

View file

@ -1,5 +1,5 @@
export const CustomErrors = {
WINDOWS_NATIVE_IMAGE_PROCESSING_NOT_SUPPORTED:
'Windows native image processing is not supported',
INVALID_OS: 'Invalid OS',
INVALID_OS: (os: string) => `Invalid OS - ${os}`,
};

View file

@ -161,7 +161,7 @@ function constructConvertCommand(
}
);
} else {
throw Error(CustomErrors.INVALID_OS);
throw Error(CustomErrors.INVALID_OS(process.platform));
}
return convertCmd;
}
@ -278,9 +278,7 @@ function constructThumbnailGenerationCommand(
return cmdPart;
});
} else {
throw Error(
`${process.platform} native thumbnail generation not supported yet`
);
throw Error(CustomErrors.INVALID_OS(process.platform));
}
return thumbnailGenerationCmd;
}