I am making a connection to a websocket in Python using the WebSocketApp wrapper of websocket-client. When the server side of my connection is healthy, there are no problems. However, that server is unstable at the moment since it is being developed, so I'm trying to use this opportunity to make my client more robust.
When using Postman, I can see that when it is unhealthy, I'm getting an HTTP 400 response. So how this manifests itself in the WebSocketApp code is simply the socket closes (apparently) cleanly, but I have no indication as to why it closed on the client side. None of the callbacks get fired (on_error/data/message/etc), I'm just left with the WebSocketApp handle with its embedded sock being None.
Is there a way to be able to tell on the client side why a websocket connection failed? Note that I am NOT getting a 'teardown=True' so I'm led to believe there was no exception behind this.
For a comparison, I have a test program I wrote with the asyncio-based websockets package, and it fails as well, though with the 1005 error.
Any ideas?