Skip to content

Commit

Permalink
fix: fail gracefully when config file is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
scott113341 committed Nov 14, 2016
1 parent 0dd1c9e commit a200a15
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ function configureNode (node, conf, done) {

// Consistent error handling
function parseConfig (path, done) {
const file = fs.readFileSync(join(path, 'config'))

try {
const file = fs.readFileSync(join(path, 'config'))
const parsed = JSON.parse(file)
done(null, parsed)
} catch (err) {
Expand Down

0 comments on commit a200a15

Please sign in to comment.