Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
I tried to take a stab at the bad slack token issue. At the moment I made some changes so try and handle the flood of exceptions. I tried to start with slacker.Error but that didn't work, every little bit of the code was breaking because
slack.disconnect()
is called when a broad exception is passed and that made things break because there is nothing to disconnect.Also
slack.listen()
is running on a loop so I tried to break out of the loop if the exception happens (which it will).Finally, I had to take the raise statement from the connect because it was breaking opsdroid. I think opsdroid shouldn't crash bad if one connector doesn't work. I think most people would use more than one connector with opsdroid so it might be better to let opsdroid running.
I didn't do anything to the core yet because like I said before adding anything to it would make the if/else statement longer. I guess we could just set a return value and if it returns False opsdroid would just skip that connector?
This PR is just an idea and to be honest I am not sure if any of these changes are anything worthwhile but here it is. Let me know what do you think and then I will add tests if accepted 馃槃 馃憤
p.s.: should we add slacker to the requirements? It's not currently on them.
Fixes #764
Status
READY |
UNDER DEVELOPMENT|ON HOLDType of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.
Checklist: