pqxx::sql_error Class Reference
Exception classes

Exception class for failed queries. More...

`#include <except.hxx>`

Inheritance diagram for pqxx::sql_error:
[legend]

## Public Member Functions

| sql_error (std::string const &whatarg="", std::string const &Q="", char const sqlstate[]=nullptr)
virtual | ~sql_error () noexcept override
PQXX_PURE std::string const & | query () const noexcept
| The query whose execution triggered the exception.
PQXX_PURE std::string const & | sqlstate () const noexcept
| SQLSTATE error code if known, or empty string otherwise.
Public Member Functions inherited from pqxx::failure
| failure (std::string const &)

## Detailed Description

Exception class for failed queries.

Carries, in addition to a regular error message, a copy of the failed query and (if available) the SQLSTATE value accompanying the error.

## Constructor & Destructor Documentation

## sql_error()

pqxx::sql_error::sql_error | ( | std::string const & | whatarg = `""`,
|  | std::string const & | Q = `""`,
|  | char const | sqlstate[] = `nullptr`
| ) |  |

explicit

## ~sql_error()

pqxx::sql_error::~sql_error | ( |  | ) |

override virtual default noexcept

## Member Function Documentation

## query()

PQXX_PURE std::string const & pqxx::sql_error::query | ( |  | ) | const

noexcept

The query whose execution triggered the exception.

## sqlstate()

PQXX_PURE std::string const & pqxx::sql_error::sqlstate | ( |  | ) | const

noexcept

SQLSTATE error code if known, or empty string otherwise.

Referenced by pqxx::deadlock_detected::deadlock_detected(), pqxx::serialization_failure::serialization_failure(), pqxx::statement_completion_unknown::statement_completion_unknown(), and pqxx::transaction_rollback::transaction_rollback().

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

- except.hxx
- except.cxx