Closed fitnub-bosbud closed 1 year ago
I think maybe I understand the motivation for this change, but I'm not sure. Can you provide more detail about the situation that motivated you to make this change? Also, I'd like to come up with a solution that doesn't involve a flag, but instead has a more immediate way of detecting "first connection failure". Maybe by raising a different exception on the first connection attempt or by having a routine that encapsulates the initial connection state.
Sure thing, so basically the bot sits in an infinite loop if it initially fails to connect to a server. Here's a video example. I'd be open to coming up with another solution, but I think a flag is the easiest approach since the socket.error is raised from multiple inheritance, and this issue seems bot specific.
bump
The more I look at this, the less sure I am that it's the right behavior. Why should the behavior be to ignore connection failures but only on subsequent attempts? Unfortunately, the behavior isn't well-documented nor tested, so I have low confidence in the intent of the existing code. As you mention in the title, maybe the logic should be re-worked so that the reconnection strategy is employed when the initial connection fails. I'd like to see a more deliberate design rather than a tweak to the code.
You make a good point. Instead of a hacked together workaround I utilize the existing functionality of the client to trigger a disconnect event. If I had to guess this was probably close to what the initial author intended and perhaps forgot to implement with the
except:
pass
bump
this is the change you requested
Thanks for the ping. Released as v20.1.0. Let's see how it goes.
This change throws an exception on the first connection attempt that way the user can check server info and there is some indication of failure.