Loading...
Searching...
No Matches
errorhandler.hxx
/* Definition of the pqxx::errorhandler class.
*
* pqxx::errorhandler handlers errors and warnings in a database session.
*
* DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/errorhandler instead.
*
* Copyright (c) 2000-2024, Jeroen T. Vermeulen.
*
* See COPYING for copyright license. If you did not receive a file called
* COPYING with this source code, please notify the distributor of this
* mistake, or contact the author.
*/
#ifndef PQXX_H_ERRORHANDLER
#define PQXX_H_ERRORHANDLER
#if !defined(PQXX_HEADER_PRE)
# error "Include libpqxx headers as <pqxx/header>, not <pqxx/header.hxx>."
#endif
#include "pqxx/types.hxx"
namespace pqxx::internal::gate
{
class errorhandler_connection;
}
namespace pqxx
{
class PQXX_LIBEXPORT errorhandler
{
public:
[[deprecated("Use a notice handler instead.")]]
explicit errorhandler(connection &);
virtual ~errorhandler();
virtual bool operator()(char const msg[]) noexcept = 0;
errorhandler() = delete;
errorhandler(errorhandler const &) = delete;
errorhandler &operator=(errorhandler const &) = delete;
private:
connection *m_home;
friend class internal::gate::errorhandler_connection;
void unregister() noexcept;
};
class quiet_errorhandler : public errorhandler
{
public:
#include "pqxx/internal/ignore-deprecated-pre.hxx"
[[deprecated("Use notice handlers instead.")]]
quiet_errorhandler(connection &cx) :
errorhandler{cx}
{}
#include "pqxx/internal/ignore-deprecated-post.hxx"
virtual bool operator()(char const[]) noexcept override { return false; }
};
} // namespace pqxx
#endif
pqxx::connection
Connection to a database.
Definition connection.hxx:279
pqxx::errorhandler
Definition errorhandler.hxx:46
pqxx::errorhandler::operator()
virtual bool operator()(char const msg[]) noexcept=0
pqxx::internal::gate::errorhandler_connection
Definition errorhandler-connection.hxx:6
pqxx::quiet_errorhandler
Definition errorhandler.hxx:74
pqxx::quiet_errorhandler::operator()
virtual bool operator()(char const[]) noexcept override
Revert to previous handling of error notices.
Definition errorhandler.hxx:85
pqxx::quiet_errorhandler::quiet_errorhandler
quiet_errorhandler(connection &cx)
Suppress error notices.
Definition errorhandler.hxx:79
pqxx
The home of all libpqxx classes, functions, templates, etc.
Definition array.cxx:27