Skip to content

Commit

Permalink
Add comment for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanZim committed Feb 14, 2020
1 parent 51938c2 commit 53fbddf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/mkdirs/make-dir.js
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 53fbddf

Please sign in to comment.