query/include/matador/object/error_code.hpp

33 lines
744 B
C++

#ifndef OBJECT_ERROR_CODE_HPP
#define OBJECT_ERROR_CODE_HPP
#include <cstdint>
#include <system_error>
namespace matador::object {
enum class error_code : uint8_t {
OK = 0,
NodeNotFound = 1,
NodeAlreadyExists = 2,
Failure,
};
class object_category_impl final : public std::error_category
{
public:
[[nodiscard]] const char* name() const noexcept override;
[[nodiscard]] std::string message(int ev) const override;
};
const std::error_category& object_category();
std::error_code make_error_code(error_code e);
std::error_condition make_error_condition(error_code e);
}
template <>
struct std::is_error_code_enum<matador::object::error_code> : true_type {};
#endif //OBJECT_ERROR_CODE_HPP