11 #ifndef _RD_EXCEPTIONS_H
12 #define _RD_EXCEPTIONS_H
22 : std::runtime_error(
"IndexErrorException"),
24 _msg(
"Index Error: " + std::
to_string(_idx)){};
25 int index()
const {
return _idx; };
27 const char*
what() const noexcept
override {
return _msg.c_str(); };
42 : std::runtime_error(
"ValueErrorException"), _value(i){};
44 : std::runtime_error(
"ValueErrorException"), _value(msg){};
45 const char*
what() const noexcept
override {
return _value.c_str(); };
58 : std::runtime_error(
"KeyErrorException"),
60 _msg(
"Key Error: " +
key){};
61 std::string
key()
const {
return _key; };
63 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
const char * what() const noexcept override
Class to allow us to throw a KeyError from C++ and have it make it back to Python.
~KeyErrorException() noexcept
const char * what() const noexcept override
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)
~ValueErrorException() noexcept
const char * what() const noexcept override
ValueErrorException(const std::string &i)
static std::string to_string(const Descriptor &desc)