libpqxx
The C++ client library for PostgreSQL
Toggle main menu visibility
Loading...
Searching...
No Matches
errorhandler.hxx
Go to the documentation of this file.
1
/* Definition of the pqxx::errorhandler class.
2
*
3
* pqxx::errorhandler handlers errors and warnings in a database session.
4
*
5
* DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/errorhandler instead.
6
*
7
* Copyright (c) 2000-2025, Jeroen T. Vermeulen.
8
*
9
* See COPYING for copyright license. If you did not receive a file called
10
* COPYING with this source code, please notify the distributor of this
11
* mistake, or contact the author.
12
*/
13
#ifndef PQXX_H_ERRORHANDLER
14
#define PQXX_H_ERRORHANDLER
15
16
#if !defined(PQXX_HEADER_PRE)
17
# error "Include libpqxx headers as <pqxx/header>, not <pqxx/header.hxx>."
18
#endif
19
20
#include "
pqxx/types.hxx
"
21
22
23
namespace
pqxx::internal::gate
24
{
25
class
errorhandler_connection;
26
}
27
28
29
namespace
pqxx
30
{
35
37
45
class
PQXX_LIBEXPORT
errorhandler
46
{
47
public
:
48
[[deprecated(
"Use a notice handler instead."
)]]
49
explicit
errorhandler
(connection &);
50
virtual
~errorhandler
();
51
54
58
virtual
bool
operator()
(
char
const
msg[])
noexcept
= 0;
59
60
errorhandler
() =
delete
;
61
errorhandler
(
errorhandler
const
&) =
delete
;
62
errorhandler
&
operator=
(
errorhandler
const
&) =
delete
;
63
64
private
:
65
connection *m_home;
66
67
friend
class
internal::gate::errorhandler_connection
;
68
void
unregister() noexcept;
69
};
70
71
73
class
quiet_errorhandler
: public
errorhandler
74
{
75
public
:
76
#include "
pqxx/internal/ignore-deprecated-pre.hxx
"
78
[[deprecated(
"Use notice handlers instead."
)]]
79
quiet_errorhandler
(connection &cx) :
80
errorhandler
{cx}
81
{}
82
#include "
pqxx/internal/ignore-deprecated-post.hxx
"
83
85
virtual
bool
operator()
(
char
const
[])
noexcept
override
{
return
false
; }
86
};
87
89
}
// namespace pqxx
90
#endif
pqxx::errorhandler::errorhandler
errorhandler(connection &)
Definition
errorhandler.cxx:22
pqxx::errorhandler::errorhandler
errorhandler()=delete
pqxx::errorhandler::operator()
virtual bool operator()(char const msg[]) noexcept=0
pqxx::errorhandler::operator=
errorhandler & operator=(errorhandler const &)=delete
pqxx::errorhandler::errorhandler
errorhandler(errorhandler const &)=delete
pqxx::internal::gate::errorhandler_connection
Definition
errorhandler-connection.hxx:6
pqxx::quiet_errorhandler::operator()
virtual bool operator()(char const[]) noexcept override
End a code block started by "ignore-deprecated-pre.hxx".
Definition
errorhandler.hxx:85
pqxx::quiet_errorhandler::quiet_errorhandler
quiet_errorhandler(connection &cx)
Suppress error notices.
Definition
errorhandler.hxx:79
PQXX_LIBEXPORT
#define PQXX_LIBEXPORT
Definition
header-pre.hxx:157
ignore-deprecated-post.hxx
ignore-deprecated-pre.hxx
pqxx::internal::gate
Definition
connection.hxx:108
pqxx
The home of all libpqxx classes, functions, templates, etc.
Definition
array.cxx:27
types.hxx
include
pqxx
errorhandler.hxx
Generated by
1.17.0