Skip to content

Commit 5a4866c

Browse files
committed
add link
1 parent 35f3a33 commit 5a4866c

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

source/includes/authentication.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ auto client = mongocxx::client(uri);
4949

5050
// start-auth-err
5151
try {
52-
auto uri = mongocxx::uri("mongodb://<>"
53-
"authMechanism=<>");
52+
auto uri = mongocxx::uri("mongodb://<db_username>:<db_password>@<hostname>:<port>/?"
53+
"authSource=admin&authMechanism=SCRAM-SHA-256");
5454
auto client = mongocxx::client(uri);
55-
} catch (const mongocxx::exception& e) {
56-
std::cerr << "Error: " << e.code() << std::endl;
55+
} catch (const mongocxx::exception& ex) {
56+
std::cerr << "Error: " << ex.code() << std::endl;
5757
}
5858
// end-auth-err

source/security/authentication.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,9 @@ the error code by using the ``code()`` method.
285285
:start-after: // start-auth-err
286286
:end-before: // end-auth-err
287287

288+
For more information, see the 'Operation Exceptions page
289+
<{+api+}/topic-mongocxx-examples-operation-exceptions.html>' in the API Documentation.
290+
288291
API Documentation
289292
-----------------
290293

0 commit comments

Comments
 (0)