diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b2ac88..37febb4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,6 +52,8 @@ add_executable(App ./src/main.cpp ./src/exceptions/exception400_bad_request.h ./src/exceptions/exception409_conflict.cpp ./src/exceptions/exception409_conflict.h + ./src/exceptions/exception422_unprocessable_entity.cpp + ./src/exceptions/exception422_unprocessable_entity.h ) target_link_libraries(App PRIVATE Boost::boost Boost::json Threads::Threads mysql::concpp) diff --git a/src/exceptions/exception422_unprocessable_entity.cpp b/src/exceptions/exception422_unprocessable_entity.cpp new file mode 100644 index 0000000..bd9b9f6 --- /dev/null +++ b/src/exceptions/exception422_unprocessable_entity.cpp @@ -0,0 +1,18 @@ +#include "exception422_unprocessable_entity.h" + +#include + +using namespace std; +using namespace std::literals; + +namespace uad +{ +exception422_unprocessable_entity::exception422_unprocessable_entity(const string& info): message_(info) +{ +} + +char const* exception422_unprocessable_entity::what() const +{ + return message_.c_str(); +} +} diff --git a/src/exceptions/exception422_unprocessable_entity.h b/src/exceptions/exception422_unprocessable_entity.h new file mode 100644 index 0000000..2d80b4d --- /dev/null +++ b/src/exceptions/exception422_unprocessable_entity.h @@ -0,0 +1,16 @@ +#pragma once + +#include +#include + +namespace uad +{ +struct exception422_unprocessable_entity : std::exception +{ +private: + std::string message_; +public: + exception422_unprocessable_entity(const std::string& info); + char const* what() const override; +}; +}