Skip to content

Commit

Permalink
Make use of new error.client getter
Browse files Browse the repository at this point in the history
  • Loading branch information
jhecking committed Oct 2, 2018
1 parent c3161af commit acdf890
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Aerospike.connect(config)
return client.operate(key, ops)
})
.then(result => {
console.log(result.bins) // => { i: 124, l: 4, m: null }
console.log(result.bins) // => { i: 124, l: 4, m: null }

return client.get(key)
})
Expand All @@ -85,12 +85,13 @@ Aerospike.connect(config)
// m: { foo: 4 } }
})
.then(() => client.close())
.catch(error => {
client.close()
return Promise.reject(error)
})
})
.catch(error => console.log(error))
.catch(error => {
console.error('Error: %s [%i]', error.message, error.code)
if (error.client) {
error.client.close()
}
})
```

More examples illustrating the use of the API are located in the
Expand Down
13 changes: 7 additions & 6 deletions docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Aerospike.connect(config)
return client.operate(key, ops)
})
.then(result => {
console.log(result.bins) // => { i: 124, l: 4, m: null }
console.log(result.bins) // => { i: 124, l: 4, m: null }

return client.get(key)
})
Expand All @@ -132,12 +132,13 @@ Aerospike.connect(config)
// m: { foo: 4 } }
})
.then(() => client.close())
.catch(error => {
client.close()
return Promise.reject(error)
})
})
.catch(error => console.log(error))
.catch(error => {
console.error('Error: %s [%i]', error.message, error.code)
if (error.client) {
error.client.close()
}
})
```

## Tutorials
Expand Down

0 comments on commit acdf890

Please sign in to comment.