awslabs / awslabs/aws-crt-python
Provide more specific error for failures during MQTT WS handshake
- Dominant language
- Python
- Stars
- 100
- Forks
- 58
- Avg merge
- 13h 51m
- Merged PRs (30d)
- 2
Description
### Describe the feature
`mqtt5_client_builder.websockets_with_default_aws_signing(...)` raises a `AWS_ERROR_HTTP_CALLBACK_FAILURE` for both network errors and misconfiguration.
### Use Case
For example, if I have a misconfigured client (like I connect with invalid client TLS details, or with a client identifier which I'm not authorized), I'd like to know about it so I can terminate the process because it's never going to connect. If it's a network issue, I'd like to let the MQTT client continue retrying to connect.
### Proposed Solution
https://github.com/awslabs/aws-crt-python/blob/c11a5542141c1508d259a08e1c1d1db6a0b4c0a0/source/mqtt5_client.c#L720-L721
:)
Using `AwsCredentialProvider.get_credentials(...)` I get `AWS_IO_TLS_ERROR_NEGOTIATION_FAILURE` and `AWS_AUTH_CREDENTIALS_PROVIDER_HTTP_STATUS_FAILURE` for the misconfigurations mentioned above, and `AWS_IO_DNS_QUERY_FAILED` and `AWS_IO_DNS_INVALID_NAME` for network issues.
### Other Information
_No response_
### Acknowledgements
- [ ] I may be able to implement this feature request
- [X] This feature might incur a breaking change
Contributor guide
Assessment
This issue has not been assessed yet.