Loading...
Searching...
No Matches
mongocxx::v1::server_error Class Reference

`#include <mongocxx/v1/server_error.hpp>`

## Description

A MongoDB server error.

Important
  this->code() always returns the raw server error code. Use this->client_code() to query the client-side error code.

Inherits:
  - mongocxx::v1::exception

## Public Member Functions

std::error_code | client_code () const
| The client error code.
bsoncxx::v1::document::view | raw () const
| The raw server error.
Public Member Functions inherited from mongocxx::v1::exception
bool | has_error_label (bsoncxx::v1::stdx::string_view label) const
| Return true if this exception contains the specified error label.

## Member Function Documentation

## client_code()

std::error_code mongocxx::v1::server_error::client_code | ( |  | ) | const

The client error code.

Returns
  Default-initialized when no client error code is available.

## raw()

bsoncxx::v1::document::view mongocxx::v1::server_error::raw | ( |  | ) | const

The raw server error.

Important
  The contents of the resulting BSON document may vary depending on the operation and error.

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

- mongocxx/v1/server_error.hpp