Merge pull request #6 from dominictarr/master
callback inside of try block can obscure errors
This commit is contained in:
commit
d8627a9475
1 changed files with 3 additions and 2 deletions
|
@ -97,12 +97,13 @@ File.prototype.load = function (callback) {
|
|||
|
||||
try {
|
||||
self.store = self.format.parse(data.toString());
|
||||
callback(null, self.store);
|
||||
}
|
||||
catch (ex) {
|
||||
self.store = {};
|
||||
callback(ex);
|
||||
return callback(ex);
|
||||
}
|
||||
callback(null, self.store);
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue