11 #ifndef _RD_EXCEPTIONS_H
12 #define _RD_EXCEPTIONS_H
23 : std::runtime_error(
"IndexErrorException"),
25 _msg(
"Index Error: " + std::
to_string(_idx)) {}
26 int index()
const {
return _idx; }
28 const char*
what() const noexcept
override {
return _msg.c_str(); }
43 : std::runtime_error(
"ValueErrorException"), _value(std::move(i)) {}
45 : std::runtime_error(
"ValueErrorException"), _value(msg) {}
46 const char*
what() const noexcept
override {
return _value.c_str(); }
59 : std::runtime_error(
"KeyErrorException"),
61 _msg(
"Key Error: " + key) {}
62 std::string
key()
const {
return _key; }
64 const char*
what() const noexcept
override {
return _msg.c_str(); }
Class to allow us to throw an IndexError from C++ and have it make it back to Python.
IndexErrorException(int i)
~IndexErrorException() noexcept override=default
const char * what() const noexcept override
Class to allow us to throw a KeyError from C++ and have it make it back to Python.
const char * what() const noexcept override
~KeyErrorException() noexcept override=default
KeyErrorException(std::string key)
Class to allow us to throw a ValueError from C++ and have it make it back to Python.
ValueErrorException(const char *msg)
const char * what() const noexcept override
~ValueErrorException() noexcept override=default
ValueErrorException(std::string i)
#define RDKIT_RDGENERAL_EXPORT
static std::string to_string(const Descriptor &desc)