Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 fieldcodeName
). But at least, there arecodeName
, anderrmsg
in recent MongoDB versions.This PR is going to fix the problem by fall backing to
codeName
anderrmsg
whenerr
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.