Skip to content

Conversation

@nietsuu
Copy link

@nietsuu nietsuu commented Feb 16, 2025

I am using the WebSocketTrading and noticed that it doesn't send the error messages on the callback. It just logs the error on _V5TradeWebSocketManager._process_error_message.

I'm thinking it would be better to just send the error messages on the callback instead of logging it.

@nietsuu
Copy link
Author

nietsuu commented Feb 16, 2025

I think the current way of handling errors won't do (just logging it). Because sometimes you need to catch the errors and currently there is no way of doing that.

If this PR is not plausible. Maybe we can add another callback like error_callback solely for catching the error messages.

Copy link
Collaborator

@kolya5544 kolya5544 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes look good to me, however backwards compatability implications should be considered for people updating from older pybit versions

@nietsuu
Copy link
Author

nietsuu commented Feb 26, 2025

I think it's safe to assume that everyone that uses this don't have a code that results in error. So if they update, it really won't break anything.

And if they do have an error, they will still have to fix it anyways.
So it shouldn't be a concern in terms of compatibility in my opinion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants