MongoDB C++ Driver
mongocxx-3.10.2
|
Class representing an exception received from a MongoDB server. More...
#include <operation_exception.hpp>
Public Member Functions | |
operation_exception (std::error_code ec, bsoncxx::v_noabi::document::value &&raw_server_error, std::string what_arg="") | |
Constructs a new operation exception. More... | |
bool | has_error_label (stdx::string_view label) const |
Checks for the specified label in a operation exception. More... | |
const stdx::optional< bsoncxx::v_noabi::document::value > & | raw_server_error () const |
The optional raw bson error document from the server. More... | |
stdx::optional< bsoncxx::v_noabi::document::value > & | raw_server_error () |
The optional raw bson error document from the server. More... | |
Class representing an exception received from a MongoDB server.
It includes the server-provided error code, if one was available.
mongocxx::v_noabi::operation_exception::operation_exception | ( | std::error_code | ec, |
bsoncxx::v_noabi::document::value && | raw_server_error, | ||
std::string | what_arg = "" |
||
) |
Constructs a new operation exception.
ec | The error code associated with this exception. |
raw_server_error | The optional raw bson error document to be associated with this exception. |
what_arg | An optional message to be returned by what . |
bool mongocxx::v_noabi::operation_exception::has_error_label | ( | stdx::string_view | label | ) | const |
Checks for the specified label in a operation exception.
label | A string of the label to search for |
stdx::optional<bsoncxx::v_noabi::document::value>& mongocxx::v_noabi::operation_exception::raw_server_error | ( | ) |
The optional raw bson error document from the server.
const stdx::optional<bsoncxx::v_noabi::document::value>& mongocxx::v_noabi::operation_exception::raw_server_error | ( | ) | const |
The optional raw bson error document from the server.