userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
exception.hpp
Go to the documentation of this file.
1
#pragma once
2
5
6
#include <
userver/utils/traceful_exception.hpp
>
7
8
USERVER_NAMESPACE_BEGIN
9
10
namespace
storages::mongo
{
11
13
class
MongoException :
public
utils::TracefulException
{
14
public
:
15
MongoException();
16
17
explicit
MongoException(std::string_view what);
18
};
19
21
class
InvalidConfigException
:
public
MongoException {
22
using
MongoException::MongoException;
23
};
24
26
class
CancelledException :
public
MongoException {
27
public
:
28
struct
ByDeadlinePropagation
final {};
29
30
using
MongoException::MongoException;
31
32
explicit
CancelledException(
ByDeadlinePropagation
);
33
34
bool
IsByDeadlinePropagation()
const
;
35
36
private
:
37
bool
by_deadline_propagation_{
false
};
38
};
39
41
class
PoolNotFoundException
:
public
MongoException {
42
using
MongoException::MongoException;
43
};
44
46
class
PoolOverloadException
:
public
MongoException {
47
using
MongoException::MongoException;
48
};
49
51
class
TransactionException :
public
MongoException {
52
public
:
53
enum class
Type
{
54
kTransientError
,
55
kPermanentError
,
56
kUnknownCommitResult
,
57
};
58
59
TransactionException
(
Type
type, std::string_view what);
60
61
Type
GetType() const noexcept {
return
type_; }
62
63
private
:
64
Type
type_;
65
};
66
68
class
NetworkException
:
public
MongoException {
69
public
:
70
using
MongoException::MongoException;
71
};
72
74
class
ClusterUnavailableException
:
public
MongoException {
75
public
:
76
using
MongoException::MongoException;
77
};
78
80
class
IncompatibleServerException
:
public
MongoException {
81
public
:
82
using
MongoException::MongoException;
83
};
84
86
class
AuthenticationException
:
public
MongoException {
87
public
:
88
using
MongoException::MongoException;
89
};
90
92
class
QueryException
:
public
MongoException {
93
public
:
94
using
MongoException::MongoException;
95
};
96
98
class
InvalidQueryArgumentException
:
public
QueryException
{
99
public
:
100
using
QueryException::QueryException;
101
};
102
104
class
ServerException :
public
QueryException
{
105
public
:
106
explicit
ServerException(
int
code)
107
: code_(code)
108
{}
109
110
int
Code()
const
{
return
code_; }
111
112
private
:
113
int
code_;
114
};
115
117
class
WriteConcernException
:
public
ServerException {
118
public
:
119
using
ServerException::ServerException;
120
};
121
123
class
DuplicateKeyException
:
public
ServerException {
124
public
:
125
using
ServerException::ServerException;
126
};
127
128
}
// namespace storages::mongo
129
130
USERVER_NAMESPACE_END
userver
storages
mongo
exception.hpp
Generated on
for userver by
Doxygen
1.17.0