userver: userver/storages/mongo/mongo_error.hpp Source File
Loading...
Searching...
No Matches
mongo_error.hpp
Go to the documentation of this file.
1#pragma once
2
5
6#include <string>
7
8#include <bson/bson.h>
9
10USERVER_NAMESPACE_BEGIN
11
12namespace storages::mongo {
13
16public:
31
34 MongoError();
36
38 explicit operator bool() const;
39
41 bool IsServerError() const;
42 Kind GetKind() const;
43
44 uint32_t Code() const;
45 const char* Message() const;
46
49 uint32_t Domain() const;
50
52 bson_error_t* GetNative();
54
56 [[noreturn]] void Throw(std::string prefix) const;
57
58private:
59 bson_error_t value_;
60};
61
62} // namespace storages::mongo
63
64USERVER_NAMESPACE_END