Thrown by db backend containing all available error information's.
More...
#include <database_error.hpp>
Inherits std::runtime_error.
|
| database_error (const char *what, std::string source, long ec, std::string sql="") |
|
| database_error (const char *what, std::string source, std::string sqlstate, long ec, std::string sql="") |
|
| database_error (const char *what, std::string source, std::string sqlstate, std::string sql="") |
|
| ~database_error () noexcept override=default |
|
const char * | source () const noexcept |
|
long | error_code () const noexcept |
|
const char * | sql_state () const noexcept |
|
const char * | sql_statement () const noexcept |
|
Thrown by db backend containing all available error information's.
This exception is thrown by the database backend and contains all available error information's provided by the backend
◆ database_error() [1/3]
matador::database_error::database_error |
( |
const char * |
what, |
|
|
std::string |
source, |
|
|
long |
ec, |
|
|
std::string |
sql = "" |
|
) |
| |
Creates a database error exception with error code.
- Parameters
-
what | Error message |
source | Database vendor string |
ec | Error code |
sql | Optional sql statement string |
◆ database_error() [2/3]
matador::database_error::database_error |
( |
const char * |
what, |
|
|
std::string |
source, |
|
|
std::string |
sqlstate, |
|
|
long |
ec, |
|
|
std::string |
sql = "" |
|
) |
| |
Creates a database error exception with sql state and error code.
- Parameters
-
what | Error message |
source | Database vendor string |
sqlstate | SQL State |
ec | Error code |
sql | Optional sql statement string |
◆ database_error() [3/3]
matador::database_error::database_error |
( |
const char * |
what, |
|
|
std::string |
source, |
|
|
std::string |
sqlstate, |
|
|
std::string |
sql = "" |
|
) |
| |
Creates a database error exception with sql state.
- Parameters
-
what | Error message |
source | Database vendor string |
sqlstate | SQL State |
sql | Optional sql statement string |
◆ ~database_error()
matador::database_error::~database_error |
( |
| ) |
|
|
overridedefaultnoexcept |
Destroy the database error
◆ error_code()
long matador::database_error::error_code |
( |
| ) |
const |
|
noexcept |
Returns a proprietary error code depending on the database backend.
- Returns
- Proprietary database error code
◆ source()
const char * matador::database_error::source |
( |
| ) |
const |
|
noexcept |
Returns the database vendor string.
- Returns
- Database vendor string
◆ sql_state()
const char * matador::database_error::sql_state |
( |
| ) |
const |
|
noexcept |
Returns the sql state according to the SQL standard provided by the database backend. It is a 5 char long string representing a sql error code.
SQL States
- Returns
- SQL State
◆ sql_statement()
const char * matador::database_error::sql_statement |
( |
| ) |
const |
|
noexcept |
If available it returns a corresponding sql statement.
- Returns
- Optional corresponding sql statement
The documentation for this class was generated from the following file:
- matador/sql/database_error.hpp