diff --git a/libs/util/include/psemek/util/not_implemented.hpp b/libs/util/include/psemek/util/not_implemented.hpp index 15a9869d..45dd01e0 100644 --- a/libs/util/include/psemek/util/not_implemented.hpp +++ b/libs/util/include/psemek/util/not_implemented.hpp @@ -1,8 +1,16 @@ #pragma once +#include + namespace psemek::util { - [[noreturn]] void not_implemented(); + struct not_implemented_error + : std::exception + { + char const * what() const noexcept override; + }; + + [[noreturn]] void not_implemented(); } diff --git a/libs/util/source/not_implemented.cpp b/libs/util/source/not_implemented.cpp index 10c39152..70515579 100644 --- a/libs/util/source/not_implemented.cpp +++ b/libs/util/source/not_implemented.cpp @@ -5,9 +5,14 @@ namespace psemek::util { + char const * not_implemented_error::what() const noexcept + { + return "not implemented"; + } + void not_implemented() { - throw std::runtime_error("Not implemented"); + throw not_implemented_error{}; } }