MDBX Containers
Loading...
Searching...
No Matches
MdbxException.hpp
Go to the documentation of this file.
1#pragma once
2#ifndef _MDBX_CONTAINERS_EXCEPTION_HPP_INCLUDED
3#define _MDBX_CONTAINERS_EXCEPTION_HPP_INCLUDED
4
7
8namespace mdbxc {
9
16 class MdbxException : public std::runtime_error {
17 public:
21 explicit MdbxException(const std::string& message, int error_code = -1)
22 : std::runtime_error("MDBXC error: " + message), m_error_code(error_code) {}
23
26 int error_code() const noexcept {
27 return m_error_code;
28 }
29
30 private:
32 };
33
34} // namespace mdbxc
35
36#endif // _MDBX_CONTAINERS_EXCEPTION_HPP_INCLUDED
MdbxException(const std::string &message, int error_code=-1)
Constructs a new MdbxException with the given message and error code.
int error_code() const noexcept
Returns the MDBX error code associated with this exception.
int m_error_code
The MDBX error code associated with the exception.