Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: websocket callback errors #15592

Closed

Conversation

PabloHiro
Copy link
Contributor

@PabloHiro PabloHiro commented Oct 22, 2024

SUMMARY

When using websockets using AWXKIT, upon error one would get the following trace:

[ERROR] error from callback <bound method WSClient._on_error of <awxkit.ws.WSClient object at 0x7fa3f355a110>>: WSClient._on_error() takes 2 positional arguments but 3 were given
[ERROR] error from callback <bound method WSClient._on_error of <awxkit.ws.WSClient object at 0x7fa3f355a110>>: WSClient._on_close() takes 2 positional arguments but 4 were given

Problem is that there is always one argument passed to the callback which is the WebSocketApp object, not to be confused with the child object WSClient. Relevant source code:
https://github.com/websocket-client/websocket-client/blob/master/websocket/_app.py#L578

With this change it is possible to get the contents of the Exception being raised

ISSUE TYPE
  • Bug, Docs Fix or other nominal change
COMPONENT NAME
  • CLI
AWX VERSION
awx:
ADDITIONAL INFORMATION

@PabloHiro PabloHiro force-pushed the fix/websocket-callback-errors branch from 61a8f90 to 2a20a0b Compare October 22, 2024 10:56
Copy link

sonarcloud bot commented Oct 22, 2024

@PabloHiro PabloHiro closed this Oct 22, 2024
@PabloHiro PabloHiro deleted the fix/websocket-callback-errors branch October 22, 2024 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant