From afd243cc87827c94f0cea73748ffc5c1fdf1880a Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 12 Jun 2021 20:54:28 +0100 Subject: Avoid direct use of runtime_error in PostgreSQL stuff Adds proper exception which extends it and gets the PostgreSQL error message. --- lib/output/pq/pqConn.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/output/pq/pqConn.h') diff --git a/lib/output/pq/pqConn.h b/lib/output/pq/pqConn.h index 5c9effb..b8609ea 100644 --- a/lib/output/pq/pqConn.h +++ b/lib/output/pq/pqConn.h @@ -14,6 +14,12 @@ namespace MyGrate { class DbValue; } namespace MyGrate::Output::Pq { + class PqErr : public std::runtime_error { + public: + PqErr(const std::string & when, PGconn *); + PqErr(const std::string & when, PGresult *); + }; + class PqConn : public DbConn { public: static constexpr auto paramMode {ParamMode::DollarNum}; -- cgit v1.2.3