aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/libpqxx/src/except.cxx
blob: 9dcc8a820128eeb64bb25013df55358e2caa1da5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/** Implementation of libpqxx exception classes.
 *
 * Copyright (c) 2000-2019, 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.
 */
#include "pqxx/compiler-internal.hxx"

#include "pqxx/except"


pqxx::pqxx_exception::~pqxx_exception() noexcept
{
}


pqxx::failure::failure(const std::string &whatarg) :
  std::runtime_error{whatarg}
{
}


pqxx::broken_connection::broken_connection() :
  failure{"Connection to database failed"}
{
}


pqxx::broken_connection::broken_connection(const std::string &whatarg) :
  failure{whatarg}
{
}


pqxx::sql_error::sql_error(
	const std::string &whatarg,
	const std::string &Q,
	const char sqlstate[]) :
  failure{whatarg},
  m_query{Q},
  m_sqlstate{sqlstate ? sqlstate : ""}
{
}


pqxx::sql_error::~sql_error() noexcept
{
}


PQXX_PURE const std::string &pqxx::sql_error::query() const noexcept
{
  return m_query;
}


PQXX_PURE const std::string &pqxx::sql_error::sqlstate() const noexcept
{
  return m_sqlstate;
}


pqxx::in_doubt_error::in_doubt_error(const std::string &whatarg) :
  failure{whatarg}
{
}


pqxx::transaction_rollback::transaction_rollback(const std::string &whatarg) :
  failure{whatarg}
{
}


pqxx::serialization_failure::serialization_failure(
	const std::string &whatarg) :
  transaction_rollback{whatarg}
{
}


pqxx::statement_completion_unknown::statement_completion_unknown(
	const std::string &whatarg) :
  transaction_rollback{whatarg}
{
}


pqxx::deadlock_detected::deadlock_detected(const std::string &whatarg) :
  transaction_rollback{whatarg}
{
}


pqxx::internal_error::internal_error(const std::string &whatarg) :
  logic_error{"libpqxx internal error: " + whatarg}
{
}


pqxx::usage_error::usage_error(const std::string &whatarg) :
  logic_error{whatarg}
{
}


pqxx::argument_error::argument_error(const std::string &whatarg) :
  invalid_argument{whatarg}
{
}


pqxx::conversion_error::conversion_error(const std::string &whatarg) :
  domain_error{whatarg}
{
}


pqxx::range_error::range_error(const std::string &whatarg) :
  out_of_range{whatarg}
{
}