Skip to content

Commit

Permalink
warn user to enable WiFi before scanning; closes #620
Browse files Browse the repository at this point in the history
  • Loading branch information
boneskull committed Apr 24, 2016
1 parent 32564aa commit 76990cc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/tessel/wifi.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ Tessel.prototype.findAvailableNetworks = function() {

return networks;
}, []).sort(compareBySignal);
})
.catch(function checkNoSuchDeviceError(err) {
if (/No such wireless device/.test(err.message)) {
return Promise.reject(new Error('Unable to find wireless networks while wifi is disabled. Run "t2 wifi --on" before trying again.'));
}
return Promise.reject(err);
});
};

Expand Down

0 comments on commit 76990cc

Please sign in to comment.