Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 3bd6788

Browse files
committedNov 28, 2015
fix the bug on dht
1 parent cd65c72 commit 3bd6788

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎src/api/dht.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ module.exports = send => {
2424
if (res.Type === 5) {
2525
cb(null, res.Extra)
2626
} else {
27-
cb(res)
27+
let error = new Error('key was not found (type 6)')
28+
cb(error)
2829
}
2930
})
3031
},

‎test/api/dht.spec.js

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ describe('.dht', () => {
44
it('returns an error when getting a non-existent key from the DHT',
55
done => {
66
apiClients['a'].dht.get('non-existent', {timeout: '100ms'}, (err, value) => {
7-
console.log(err, value)
87
expect(err).to.be.an.instanceof(Error)
98
done()
109
})

0 commit comments

Comments
 (0)
This repository has been archived.