fix: error handling and logging
fix: improve error handling and logging in EventBroadcaster
- Add dedicated connection method with proper error handling and logging
- Improve error visibility by logging connection failures at ERROR level
- Add more descriptive error messages including problematic URLs
This improves visibility of broadcast connection issues like DNS resolution failures that were previously being swallowed. Fixes issue where typos in broadcast URIs could go unnoticed due to insufficient error logging.
https://github.com/permitio/opal/issues/716
Hi @daveads - thanks for your efforts here - much appreciated. While the code seems okay - I don't think this is the right way to approach https://github.com/permitio/opal/issues/716 and https://github.com/permitio/opal/issues/711 ; As the issue here isn't that this library (fastapi_websocket_pubsub) is swallowing the errors- but that the OPAL code using it is / is using the wrong log level for communicating them.
In addition the tests are currently hanging / failing. I'd advise closing this PR and addressing the issues in OPAL itself
CC: @gemanor , @danyi1212
Hi @daveads - thanks for your efforts here - much appreciated. While the code seems okay - I don't think this is the right way to approach permitio/opal#716 and permitio/opal#711 ; As the issue here isn't that this library (fastapi_websocket_pubsub) is swallowing the errors- but that the OPAL code using it is / is using the wrong log level for communicating them.
In addition the tests are currently hanging / failing. I'd advise closing this PR and addressing the issues in OPAL itself
CC: @gemanor , @danyi1212
I’ll check this out later to debug further. In the meantime, the PR can be closed.
@orweis, could you run these tests locally? I found out they were failing on the master branch as well, not just in this PR.
In that case I'd need to ask @obsd and @danyi1212 to look at them
In that case I'd need to ask @obsd and @danyi1212 to look at them
sure...