diff --git a/lib/mkdirs/make-dir.js b/lib/mkdirs/make-dir.js index 39654b48..ecfcaf60 100644 --- a/lib/mkdirs/make-dir.js +++ b/lib/mkdirs/make-dir.js @@ -82,6 +82,8 @@ module.exports.makeDir = async (input, options) => { try { const stats = await fs.stat(pth) if (!stats.isDirectory()) { + // This error is never exposed to the user + // it is caught below, and the original error is thrown throw new Error('The path is not a directory') } } catch { @@ -129,6 +131,8 @@ module.exports.makeDirSync = (input, options) => { try { if (!fs.statSync(pth).isDirectory()) { + // This error is never exposed to the user + // it is caught below, and the original error is thrown throw new Error('The path is not a directory') } } catch {