Skip to content

Commit

Permalink
fix try/catch callback
Browse files Browse the repository at this point in the history
  • Loading branch information
mhkeller committed Feb 9, 2017
1 parent d54f201 commit 5ffd5a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -652,10 +652,11 @@ readers.readData = function (path, opts_, cb_) {
} else {
parsed = 'Your specified parser is not properly formatted. It must either be a function or have a `parse` method.'
}
cb(null, parsed)
} catch (err) {
cb(err)
return
}
cb(null, parsed)
})
}

Expand Down

0 comments on commit 5ffd5a8

Please sign in to comment.