Skip to content
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

Merged
merged 2 commits into from
Feb 26, 2019

Conversation

vasco-santos
Copy link
Member

@vasco-santos vasco-santos commented Feb 19, 2019

Added error codes to the dht and pubsub errors, as well as replaced setImmediate by nextTick.

In the context of ipfs/js-ipfs#1879

@ghost ghost assigned vasco-santos Feb 19, 2019
@ghost ghost added the status/in-progress In progress label Feb 19, 2019
@jacobheun
Copy link
Contributor

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'))

@vasco-santos vasco-santos force-pushed the chore/add-error-codes-to-dht-and-pubsub-errors branch from 097543f to a3271ec Compare February 19, 2019 19:55
@vasco-santos
Copy link
Member Author

Thanks @jacobheun

That should be fixed

Copy link
Contributor

@jacobheun jacobheun left a 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.

@vasco-santos vasco-santos force-pushed the chore/add-error-codes-to-dht-and-pubsub-errors branch 3 times, most recently from 7cfb25c to 58d49d5 Compare February 20, 2019 17:03
@vasco-santos
Copy link
Member Author

I added tests for all of those!

@vasco-santos vasco-santos force-pushed the chore/add-error-codes-to-dht-and-pubsub-errors branch from 58d49d5 to f3f4d46 Compare February 25, 2019 10:29
@jacobheun
Copy link
Contributor

@vasco-santos it looks like linting needs to be fixed in the tests.

@vasco-santos vasco-santos force-pushed the chore/add-error-codes-to-dht-and-pubsub-errors branch from f3f4d46 to e4ae152 Compare February 26, 2019 12:35
@jacobheun jacobheun merged commit de84ee4 into master Feb 26, 2019
@jacobheun jacobheun deleted the chore/add-error-codes-to-dht-and-pubsub-errors branch February 26, 2019 14:15
@ghost ghost removed the status/in-progress In progress label Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants