forked from bskari/mysql-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMySqlException.hpp
31 lines (23 loc) · 909 Bytes
/
MySqlException.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef MY_SQL_EXCEPTION_HPP_
#define MY_SQL_EXCEPTION_HPP_
#include <mysql/mysql.h>
#include <exception>
#include <string>
class MySqlPreparedStatement;
class MySqlException : public std::exception {
public:
explicit MySqlException(const std::string& message);
explicit MySqlException(const MYSQL* const connection);
explicit MySqlException(const MySqlPreparedStatement& statement);
~MySqlException() noexcept;
// MySqlException& operator=(const MySqlException&) = delete;
// MySqlException& operator=(MySqlException&&) = delete;
const char* what() const noexcept;
static const char* getServerErrorMessage(
const MYSQL* const connection);
static const char* getServerErrorMessage(
const MYSQL_STMT* const statement);
private:
const std::string message_;
};
#endif // MY_SQL_EXCEPTION_HPP_