userver: userver/storages/mysql/exceptions.hpp Source File
⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
exceptions.hpp
Go to the documentation of this file.
1#pragma once
2
3/// @file userver/storages/mysql/exceptions.hpp
4
5#include <stdexcept>
6
7USERVER_NAMESPACE_BEGIN
8
9namespace storages::mysql {
10
11/// @brief Base class for all uMySQL driver exceptions
12class MySQLException : public std::runtime_error {
13 public:
14 MySQLException(unsigned int error, const char* message);
15 MySQLException(unsigned int error, const std::string& message);
16
17 ~MySQLException() override;
18
19 unsigned int GetErrno() const;
20
21 private:
22 unsigned int errno_;
23};
24
25/// @brief IO exception (read/write timeout/cancelled)
27 public:
28 using MySQLException::MySQLException;
29
30 ~MySQLIOException() override;
31};
32
33/// @brief Statement exception - something went wrong with the statement
35 public:
36 using MySQLException::MySQLException;
37
38 ~MySQLStatementException() override;
39};
40
41/// @brief Command exception - something went wrong with the command
43 public:
44 using MySQLException::MySQLException;
45
46 ~MySQLCommandException() override;
47};
48
49/// @brief Transaction exception - something went wrong with the transaction
51 public:
52 using MySQLException::MySQLException;
53
54 ~MySQLTransactionException() override;
55};
56
57/// @brief
59 public:
60 using MySQLException::MySQLException;
61
62 ~MySQLValidationException() override;
63};
64
65} // namespace storages::mysql
66
67USERVER_NAMESPACE_END