Skip to content

Commit

Permalink
handling err
Browse files Browse the repository at this point in the history
  • Loading branch information
roccomuso committed Nov 9, 2017
1 parent 5c778e3 commit c282ab7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ var options = {

var client = ads.connect(options, function() {
this.readDeviceInfo(function(err, result) {
if (err) console.log(err)
console.log(result)
this.end()
})
Expand Down Expand Up @@ -74,6 +75,7 @@ var myHandle = {

var client = ads.connect(options, function() {
this.read(myHandle, function(err, handle) {
if (err) console.log(err)
//result is the myHandle object with the new properties filled in
console.log(handle.value)
//All handles will be released automaticly here
Expand All @@ -88,7 +90,9 @@ var client = ads.connect(options, function() {
var client = ads.connect(options, function() {
myHandle.value = 5
this.write(myHandle, function(err) {
if (err) console.log(err)
this.read(myHandle, function(err, handle) {
if (err) console.log(err)
console.log(handle.value)
this.end()
})
Expand Down Expand Up @@ -133,6 +137,7 @@ process.on('SIGINT', function() {
```javascript
client = ads.connect(options, function() {
this.getSymbols(function(err, symbols) {
if (err) console.log(err)
console.log(symbols)
this.end()
})
Expand Down

0 comments on commit c282ab7

Please sign in to comment.