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.
Coverage increased (+0.02%) to 93.017% when pulling d8b6cbed10a1a979b6165f9a76fb2e6dc6f71867 on Gowee:fixerrmsg into d0161a63e8eafe3eca18a0e2f7ceac6d368eea5e on twisted:master.
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.