Skip to content
This repository has been archived by the owner on Apr 17, 2020. It is now read-only.

Commit

Permalink
feat: try-catch around loading devices
Browse files Browse the repository at this point in the history
This fix #4 no more crash when loading incorrect device list.
  • Loading branch information
Stephan van Rooij committed Dec 22, 2017
1 parent a50e9e7 commit c480451
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ function start () {
fs.access(config.devices, fs.constants.R_OK, (err) => {
if (!err) {
log.info('Loading devices from: ' + config.devices)
devices = require(config.devices)
try {
devices = require(config.devices)
} catch(e){
log.error('Error loading devices: ',e)
}

}
})
}
Expand Down

0 comments on commit c480451

Please sign in to comment.