MongoDB C++ Driver mongocxx-3.11.0
Loading...
Searching...
No Matches
operation_exception.hpp
Go to the documentation of this file.
1// Copyright 2009-present MongoDB, Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#pragma once
16
17#include <string>
18
20
23
25#include <mongocxx/stdx.hpp>
26
28
30
31namespace mongocxx {
32namespace v_noabi {
33
34BSONCXX_PUSH_WARNINGS();
35BSONCXX_DISABLE_WARNING(MSVC(4251));
36BSONCXX_DISABLE_WARNING(MSVC(4275));
37
46 public:
47 ~operation_exception() override;
48
50 operation_exception& operator=(operation_exception&&) = default;
52 operation_exception& operator=(const operation_exception&) = default;
53
54 using exception::exception;
55
66 operation_exception(std::error_code ec,
68 std::string what_arg = "");
69
80
90
91 private:
93};
94
95BSONCXX_POP_WARNINGS();
96
97} // namespace v_noabi
98} // namespace mongocxx
99
101
103
The bsoncxx macro guard postlude header.
The bsoncxx macro guard prelude header.
A read-only BSON document that owns its underlying buffer. When a document::value goes out of scope,...
Definition value.hpp:38
A polyfill for std::optional<T>.
Definition optional.hpp:874
A polyfill for std::string_view.
Definition string_view.hpp:503
A class to be used as the base class for all mongocxx exceptions.
Definition exception.hpp:36
Class representing an exception received from a MongoDB server. It includes the server-provided error...
Definition operation_exception.hpp:45
operation_exception(std::error_code ec, bsoncxx::v_noabi::document::value &&raw_server_error, std::string what_arg="")
Constructs a new operation exception.
stdx::optional< bsoncxx::v_noabi::document::value > & raw_server_error()
The optional raw bson error document from the server.
const stdx::optional< bsoncxx::v_noabi::document::value > & raw_server_error() const
The optional raw bson error document from the server.
bool has_error_label(stdx::string_view label) const
Checks for the specified label in a operation exception.
Provides bsoncxx::v_noabi::document::value.
The mongocxx macro guard postlude header.
The mongocxx macro guard prelude header.
Provides mongocxx::v_noabi::exception.
The top-level namespace within which all mongocxx library entities are declared.
Declares mongocxx::v_noabi::operation_exception.
Provides std::optional-related polyfills for library API usage.
Redeclares bsoncxx::v_noabi::stdx in mongocxx::v_noabi::stdx for internal use.