MongoDB C++ Driver
4.2.0
Loading...
Searching...
No Matches
server_error.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 <
mongocxx/v1/server_error-fwd.hpp
>
// IWYU pragma: export
18
19
//
20
21
#include <
mongocxx/v1/detail/prelude.hpp
>
22
23
#include <
bsoncxx/v1/document/view-fwd.hpp
>
24
25
#include <
bsoncxx/v1/detail/macros.hpp
>
26
27
#include <
mongocxx/v1/config/export.hpp
>
28
#include <
mongocxx/v1/exception.hpp
>
// IWYU pragma: export
29
30
#include <memory>
31
#include <system_error>
32
33
namespace
mongocxx
{
34
namespace
v1
{
35
36
BSONCXX_PRIVATE_WARNINGS_PUSH();
37
BSONCXX_PRIVATE_WARNINGS_DISABLE(MSVC(4251));
38
BSONCXX_PRIVATE_WARNINGS_DISABLE(MSVC(4275));
39
49
class
server_error :
public
v1::exception
{
50
private
:
51
class
impl;
52
std::shared_ptr<impl> _impl;
53
54
public
:
60
std::error_code
MONGOCXX_ABI_CDECL
client_code
()
const
;
61
67
bsoncxx::v1::document::view
MONGOCXX_ABI_CDECL
raw
()
const
;
68
69
class
internal;
70
71
private
:
72
MONGOCXX_ABI_NO_EXPORT
/* explicit(false) */
73
server_error(
int
code,
char
const
* message, std::unique_ptr<impl> impl);
74
75
MONGOCXX_ABI_NO_EXPORT
void
key_function()
const override
;
76
};
77
78
BSONCXX_PRIVATE_WARNINGS_POP();
79
80
}
// namespace v1
81
}
// namespace mongocxx
82
83
#include <
mongocxx/v1/detail/postlude.hpp
>
84
macros.hpp
For internal use only!
bsoncxx::v1::document::view
A non-owning, read-only BSON document.
Definition
view.hpp:54
mongocxx::v1::exception
Base class for all exceptions thrown by mongocxx::v1.
Definition
exception.hpp:103
mongocxx::v1::server_error::raw
bsoncxx::v1::document::view raw() const
The raw server error.
mongocxx::v1::server_error::client_code
std::error_code client_code() const
The client error code.
export.hpp
Provides macros to control the set of symbols exported in the ABI.
MONGOCXX_ABI_CDECL
#define MONGOCXX_ABI_CDECL
Expands to __cdecl when built with MSVC on Windows.
Definition
export.hpp:49
MONGOCXX_ABI_NO_EXPORT
#define MONGOCXX_ABI_NO_EXPORT
Excludes the associated entity from being part of the ABI.
Definition
export.hpp:20
postlude.hpp
The mongocxx v1 macro guard postlude header.
prelude.hpp
The mongocxx v1 macro guard prelude header.
exception.hpp
Provides mongocxx error-handling utilities.
mongocxx::v1
Declares entities whose ABI stability is guaranteed for documented symbols.
mongocxx
The top-level namespace within which all mongocxx library entities are declared.
server_error-fwd.hpp
Declares mongocxx::v1::server_error.
view-fwd.hpp
Declares bsoncxx::v1::document::view.
mongocxx
v1
server_error.hpp
Generated by
1.15.0