-
Notifications
You must be signed in to change notification settings - Fork 448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add error codes to dht and pubsub errors #328
chore: add error codes to dht and pubsub errors #328
Conversation
It would be good to have the codes exported from a constants file so we don't risk miss typing them. Also, most of the nextTick logic could probably just have the anonymous function removed since it doesn't need any local references. nextTick(callback, errCode(new Error('DHT is not available'), 'ERR_DHT_DISABLED')) |
097543f
to
a3271ec
Compare
Thanks @jacobheun That should be fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There aren't any tests right now for the pubsub error. We should add a test suite for trying to call the pubsub methods with the node not started yet.
7cfb25c
to
58d49d5
Compare
I added tests for all of those! |
58d49d5
to
f3f4d46
Compare
@vasco-santos it looks like linting needs to be fixed in the tests. |
f3f4d46
to
e4ae152
Compare
Added error codes to the dht and pubsub errors, as well as replaced
setImmediate
bynextTick
.In the context of ipfs/js-ipfs#1879