Our current Catch2 helper for matching against an expected exception message produces this output on failure:
with expansion:
Failed to resolve doesnotexist.invalid: generic server error mongocxx::
exception contains message: "parse error"
While certainly useful, it is misleading: the exception does NOT contain the message "parse error". Instead, that is the message it was /expected/ to contain:
std::string describe() const override
{ return std::string("mongocxx::exception contains message: \"") + expected_msg + "\""; }If the reader of the test message trusts the explanation, this can cause some real head-scratching.
This should be corrected so that the intent and output match, something like:
exception was expected to contain: "parse error"