Skip to content

Commit

Permalink
Placeholder device needs access to internal API
Browse files Browse the repository at this point in the history
  • Loading branch information
aholstenson committed Jan 26, 2018
1 parent 60eaeb7 commit 51541b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/connectToDevice.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ module.exports = function(options) {
// Error handling - make sure to always release the handle
handle.release();

e.device = null;
throw e;
})
.then(device => {
Expand Down
2 changes: 2 additions & 0 deletions lib/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,12 @@ class DeviceInfo {
// Could not call the info method, this might be either a timeout or a token problem
const e = new Error('Could not connect to device, token might be wrong');
e.code = 'connection-failure';
e.device = this;
throw e;
} else {
const e = new Error('Could not connect to device, token needs to be specified');
e.code = 'missing-token';
e.device = this;
throw e;
}
});
Expand Down

0 comments on commit 51541b4

Please sign in to comment.