Sourav Basu Roy
 · Algo Trader with Python and Fyers API

websocket : (RuntimeError('cannot join current thread'),)

Resolved

Seeing this error on the websocket `error_handler()`.

```

2024-02-21 15:30:00,724 - trailing.py > error_handler() # 230 [ERROR] args: (RuntimeError('cannot join current thread'),)

2024-02-21 15:30:00,724 - trailing.py > error_handler() # 231 [ERROR] args: {}

2024-02-21 15:30:00,724 - trailing.py > close_handler() # 234 [ERROR] args: ({'code': 200, 'message': 'Connection Closed', 's': 'ok'},)

````

my web socket error handler looks like this:

    def error_handler(self, *args, **kwargs):
        log.error(f"args: {args}")
        log.error(f"args: {kwargs}")

This is causing the program to not terminate after the websocket closes at 3:30 PM

Not sure how to handle this on my end, any help will be welcome.

5 replies