diff --git a/export.cpp b/export.cpp index 58f3220..d01a961 100644 --- a/export.cpp +++ b/export.cpp @@ -165,6 +165,8 @@ IT& to(const object& obj, IT& it, int tab) return vector_to(obj, it, tab); case Map: return map_to(obj, it, tab); + default: + throw std::runtime_error("Unknown value_type"); } return it; } diff --git a/import.hpp b/import.hpp index 58a75a4..1f76744 100644 --- a/import.hpp +++ b/import.hpp @@ -1,6 +1,7 @@ #ifndef TOKOX_CPP_JSON_IMPORT_HPP #define TOKOX_CPP_JSON_IMPORT_HPP +#include #include "object.hpp" namespace tokox::json @@ -35,7 +36,7 @@ class import_error : public std::exception case VALUE_NOT_IMPLEMENTED: return "Value not implemented!"; default: - return "Unknown error!"; + throw std::runtime_error("Unknown error_type!"); } } private: