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 retrieving error messages #274

Merged
merged 1 commit into from Jun 3, 2021
Merged

Conversation

Gowee
Copy link
Contributor

@Gowee Gowee commented Jun 3, 2021

Hi.

As is reported in #236, error messages in exceptions raised by txmongo are sometimes ambiguous.

The reason is that txmongo only picks the field err, which is not present all the time even if there are actual errors. I cannot find a detailed and exhaustive documentation for all possible fields (there are some related documentations, but for example, none of them formally documents the existence of the field codeName). But at least, there are codeName, and errmsg in recent MongoDB versions.

This PR is going to fix the problem by fall backing to codeName and errmsg when err is not present. It picks any of the three fields whichever is present.

It should partially fix #236, giving a detailed error message:
TxMongo: AtlasError: no SNI name sent, make sure using a MongoDB 3.4+ driver/shell.

when err is not present, fallback to pick codeName and/or errmsg
@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 93.017% when pulling d8b6cbe on Gowee:fixerrmsg into d0161a6 on twisted:master.

@IlyaSkriblovsky
Copy link
Contributor

Thanks, this looks reasonable

@IlyaSkriblovsky IlyaSkriblovsky merged commit ebaf0a6 into twisted:master Jun 3, 2021
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.

"no SNI name sent" when connecting to a Mongo Atlas M0 Cluster
3 participants