MySQL++ Reference Manual

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

# mysqlpp::ConnectionFailed Class Reference

Exception thrown when there is a problem related to the database server connection. More...

`#include <exceptions.h>`

Inheritance diagram for mysqlpp::ConnectionFailed:

[legend]
Collaboration diagram for mysqlpp::ConnectionFailed:

[legend]
List of all members.

## Public Member Functions
| ConnectionFailed (const char *w="", int e=0)
| Create exception object.
int | errnum () const
| Return the error number corresponding to the error message returned by what(), if any.

## Detailed Description

Exception thrown when there is a problem related to the database server connection.

This is thrown not just on making the connection, but also on shutdown and when calling certain of Connection's methods that require a connection when there isn't one.

## Constructor & Destructor Documentation

mysqlpp::ConnectionFailed::ConnectionFailed | ( | const char * | w = `""`,
|  | int | e = `0` |
| ) |  |  | `[inline, explicit]`

Create exception object.

Parameters:

  | w | explanation for why the exception was thrown
  | e | the error number from the underlying database API

## Member Function Documentation

int mysqlpp::ConnectionFailed::errnum | ( |  | ) | const`[inline]`

Return the error number corresponding to the error message returned by what(), if any.

If the error number is 0, it means that the error message doesn't come from the underlying database API, but rather from MySQL++ itself. This happens when an error condition is detected up at this higher level instead of letting the underlying database API do it.

The documentation for this class was generated from the following file:

- exceptions.h