Go to the documentation of this file.
31 #if !defined(MYSQLPP_EXCEPTIONS_H)
32 #define MYSQLPP_EXCEPTIONS_H
45 class MYSQLPP_EXPORT Exception :
public std::exception
49 Exception(
const Exception& e) MAY_THROW() :
56 Exception& operator=(
const Exception& rhs)
throw()
63 ~Exception() throw() { }
66 virtual const char* what()
const throw()
79 Exception(
const std::string& w)
throw() :
91 class MYSQLPP_EXPORT BadConversion :
public Exception
94 const char* type_name;
107 size_t r,
size_t a) :
114 what_ += d ? d :
"<NULL>";
115 what_ +=
"\" incompatible with \"";
128 const char* d,
size_t r,
size_t a) :
144 type_name(
"unknown"),
161 class MYSQLPP_EXPORT BadFieldName :
public Exception
167 explicit BadFieldName(
const char* bad_field) :
168 Exception(std::string(
"Unknown field name: ") + bad_field)
173 ~BadFieldName() throw() { }
188 explicit BadIndex(
const char* what,
int bad_index,
int max_index) :
191 std::ostringstream outs;
192 outs <<
"Index " << bad_index <<
" on " << what <<
193 " out of range, max legal index is " << max_index;
205 class MYSQLPP_EXPORT BadOption :
public Exception
209 explicit BadOption(
const char* w,
const std::type_info& ti) :
216 explicit BadOption(
const std::string& w,
const std::type_info& ti) :
226 const std::type_info& what_option()
const {
return ti_; }
229 const std::type_info& ti_;
254 class MYSQLPP_EXPORT UseQueryError :
public Exception
258 explicit UseQueryError(
const char* w =
"") :
292 explicit BadQuery(
const char* w =
"",
int e = 0) :
302 explicit BadQuery(
const std::string& w,
int e = 0) :
314 int errnum()
const {
return errnum_; }
328 class MYSQLPP_EXPORT ConnectionFailed :
public Exception
335 explicit ConnectionFailed(
const char* w =
"",
int e = 0) :
349 int errnum()
const {
return errnum_; }
380 int errnum()
const {
return errnum_; }
393 explicit MutexFailed(
const char* w =
"lock failed") :
456 class MYSQLPP_EXPORT BadInsertPolicy :
public Exception
469 #endif // !defined(MYSQLPP_EXCEPTIONS_H)
Base class for all MySQL++ custom exceptions.
Definition: exceptions.h:67
Exception thrown when an object with operator [] or an at() method gets called with a bad index.
Definition: exceptions.h:202
Used within MySQL++'s test harness only.
Definition: exceptions.h:438
Thrown from the C++ to SQL data type conversion routine when it can't figure out how to map the type.
Definition: exceptions.h:460
Exception thrown when a bad type conversion is attempted.
Definition: exceptions.h:113
Exception thrown when you pass an unrecognized option to Connection::set_option().
Definition: exceptions.h:227
Declares the Option class hierarchy, used to implement connection options in Connection and DBDriver ...
Exception thrown when an insert policy is too strict to create a valid INSERT statement.
Definition: exceptions.h:478
Exception thrown when the database server encounters a problem while processing your query.
Definition: exceptions.h:307
Exception thrown when not enough query parameters are provided.
Definition: exceptions.h:260
Exception thrown when a BeecryptMutex object fails.
Definition: exceptions.h:411
Exception thrown when you try to use an object that isn't completely initialized.
Definition: exceptions.h:425
Exception thrown when the program tries to select a new database and the database server refuses for ...
Definition: exceptions.h:381