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 (const std::string &msg="", const std::string &Q="", const char sqlstate[]=nullptr)
virtual | ~sql_error () noexcept
const PQXX_PURE std::string & | query () const noexcept
| The query whose execution triggered the exception. More...
const PQXX_PURE std::string & | sqlstate () const noexcept
| SQLSTATE error code if known, or empty string otherwise. More...
Public Member Functions inherited from pqxx::failure
| failure (const std::string &)
Public Member Functions inherited from pqxx::pqxx_exception
virtual | ~pqxx_exception () noexcept=0
| Support run-time polymorphism, and keep this class abstract. More...

## 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 | ( | const std::string & | msg = `""`,
|  | const std::string & | Q = `""`,
|  | const char | sqlstate[] = `nullptr`
| ) |  |

explicit

## ~sql_error()

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

virtual noexcept

## Member Function Documentation

## query()

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

noexcept

The query whose execution triggered the exception.

## sqlstate()

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

noexcept

SQLSTATE error code if known, or empty string otherwise.

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

- except.hxx
- except.cxx