Cppgres
Build Postgres extensions in C++
Loading...
Searching...
No Matches
exception.hpp
Go to the documentation of this file.
1
4#pragma once
5
6namespace cppgres {
7class pg_exception : public std::exception {
8 ::MemoryContext mcxt;
9 ::MemoryContext error_cxt;
10 ::ErrorData *error;
11
12 pg_exception(::MemoryContext mcxt);
13
14 const char *what() const noexcept override { return error->message; }
15
16 template <typename Func> friend struct ffi_guard;
17
18public:
19 const char *message() const noexcept { return error->message; }
21};
22} // namespace cppgres
Definition: exception.hpp:7
Definition: guard.hpp:19