Skip to content

Commit

Permalink
catch error when read file failed
Browse files Browse the repository at this point in the history
  • Loading branch information
yaniswang committed Oct 13, 2015
1 parent f9a49c1 commit 98a1784
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bin/htmlhint
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,10 @@ function walkPath(globInfo, callback, onFinish) {

// hint file
function hintFile(filepath, ruleset){
var content = fs.readFileSync(filepath, 'utf-8');
var content = '';
try{
content = fs.readFileSync(filepath, 'utf-8');
}
catch(e){}
return HTMLHint.verify(content, ruleset);
}

0 comments on commit 98a1784

Please sign in to comment.