Skip to content

Commit

Permalink
refactor(error): add more useful errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ph1p committed Apr 23, 2019
1 parent eecad87 commit 3bef503
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
11 changes: 10 additions & 1 deletion cmds/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,16 @@ async function generate(argv) {
]
});
} catch (e) {
console.log(chalk.black.bgBlue('exclude by config'), `${folderPath}/${fileName}.md`);
const isConfigExclude = e.message.includes('no input files');

if (!isConfigExclude) {
console.log(e.message);
}

console.log(
chalk.black.bgRed(isConfigExclude ? 'exclude by config' : 'error'),
`${folderPath}/${fileName}.md`
);
}
}

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@
},
"dependencies": {
"@vuedoc/md": "^1.6.0",
"bluebird": "^3.5.3",
"bluebird": "^3.5.4",
"chalk": "^2.4.2",
"cross-env": "^5.2.0",
"del": "^4.1.0",
"front-matter": "^3.0.1",
"front-matter": "^3.0.2",
"fs.promised": "^3.0.0",
"jsdoc-to-markdown": "^4.0.1",
"micromatch": "^3.1.10",
"micromatch": "^4.0.2",
"mkdirp": "^0.5.1",
"rimraf": "^2.6.3",
"yargs": "^13.2.2"
Expand All @@ -80,7 +80,7 @@
"conventional-changelog-cli": "^2.0.12",
"eslint": "^5.14.1",
"husky": "^1.3.1",
"jest": "^24.6.0",
"jest": "^24.7.1",
"lint-staged": "^8.1.4"
},
"lint-staged": {
Expand Down

0 comments on commit 3bef503

Please sign in to comment.