userver: userver/ydb/exceptions.hpp Source File
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
exceptions.hpp
1#pragma once
2
3#include <ydb-cpp-sdk/client/types/status/status.h>
4
5#include <stdexcept>
6#include <string>
7#include <string_view>
8
9USERVER_NAMESPACE_BEGIN
10
11namespace ydb {
12
13class BaseError : public std::runtime_error {
14 using std::runtime_error::runtime_error;
15};
16
18public:
19 explicit YdbResponseError(std::string_view operation_name, NYdb::TStatus&& status);
20
21 const NYdb::TStatus& GetStatus() const noexcept;
22
23private:
24 NYdb::TStatus status_;
25};
26
28public:
29 explicit UndefinedDatabaseError(std::string error);
30};
31
33public:
34 explicit EmptyResponseError(std::string_view expected);
35};
36
37class ParseError : public BaseError {
38public:
39 explicit ParseError(std::string error);
40};
41
43public:
44 ColumnParseError(std::string_view column_name, std::string_view message);
45};
46
48public:
49 TypeMismatchError(std::string_view name, std::string_view expected, std::string_view actual);
50};
51
53public:
54 explicit DeadlineExceededError(std::string msg);
55};
56
58public:
59 InvalidTransactionError();
60};
61
63public:
64 OperationCancelledError();
65};
66
68public:
69 ResponseTruncatedError();
70};
71
73public:
74 TransactionForceRollback();
75};
76
78public:
79 IgnoreResultsError(std::string err);
80};
81
82} // namespace ydb
83
84USERVER_NAMESPACE_END