Loading...
Searching...
No Matches
mongocxx::v_noabi::operation_exception Class Reference

`#include <mongocxx/v_noabi/mongocxx/exception/operation_exception.hpp>`

## Description

An exception thrown during a MongoDB server operation.

See also
  - mongocxx::v_noabi::exception

## 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.
bool | has_error_label (bsoncxx::v_noabi::stdx::string_view label) const
| Checks for the specified label in a operation exception.
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::value > const & | raw_server_error () const
| The optional raw bson error document from the server.
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::value > & | raw_server_error ()
| The optional raw bson error document from the server.

## Constructor & Destructor Documentation

## operation_exception()

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.

Parameters

  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.

## Member Function Documentation

## has_error_label()

bool mongocxx::v_noabi::operation_exception::has_error_label | ( | bsoncxx::v_noabi::stdx::string_view | label | ) | const

Checks for the specified label in a operation exception.

Parameters

  label | A string of the label to search for

Returns
  True if the label is found in the operation exception, and false otherwise.

## raw_server_error() [1/2]

bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::value > & mongocxx::v_noabi::operation_exception::raw_server_error | ( |  | ) |

The optional raw bson error document from the server.

Returns
  The raw server error, if it is available.

## raw_server_error() [2/2]

bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::value > const & mongocxx::v_noabi::operation_exception::raw_server_error | ( |  | ) | const

The optional raw bson error document from the server.

Returns
  The raw server error, if it is available.

The documentation for this class was generated from the following file:

- mongocxx/v_noabi/mongocxx/exception/operation_exception.hpp