summaryrefslogtreecommitdiff
path: root/libodbcpp/error.h
blob: 73fa3bc73118b951afc74f81adf0b697779390aa (plain)
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
#ifndef ODBC_ERROR_H
#define ODBC_ERROR_H

#include <sql.h>
#include <stdlib.h>
#include <exception>

namespace ODBC {
	class Error : public std::exception {
		public:
			Error(RETCODE err, SQLSMALLINT handletype, SQLHANDLE handle, char const * action, ...)
				__attribute__((format(printf, 5, 6)));
			Error(char const * action, ...)
				__attribute__((format(printf, 2, 3)));
			~Error() throw();

			const char * what() const throw();
		protected:
			Error(char * msg);
		private:
			char * msg;
	};
}

#endif