holepunchto / hyperswarm

A distributed networking stack for connecting peers.
https://docs.holepunch.to
MIT License
1.06k stars 85 forks source link

add usage error for invalid keys #15

Closed robertkowalski closed 5 years ago

robertkowalski commented 5 years ago

this makes it easier for people to see what is wrogn when they receive

/Users/robert/bitfinex/network/node_modules/xor-distance/index.js:4
  if (a.length !== b.length) throw new Error('Inputs should have the same length')
                                   ^

Error: Inputs should have the same length
    at dist (/Users/robert/bitfinex/network/node_modules/xor-distance/index.js:4:36)

or:

/Users/robert/bitfinex/hcbench/node_modules/k-bucket/index.js:60
    throw new TypeError(name + ' is not a Uint8Array')
    ^

TypeError: id is not a Uint8Array
    at ensureInt8 (/Users/robert/bitfinex/hcbench/node_modules/k-bucket/index.js:60:11)

relaeted: #11

davidmarkclements commented 5 years ago

addressed in v2 refactor - thank you!