From 049fcf0f4869d509de88b802c7221b67115c7dec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D1=82=D0=BE=D0=BD?= Date: Mon, 29 Sep 2025 07:42:50 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D1=81=D1=82=D1=80=D1=83=D0=BA=D1=82=D1=83=D1=80?= =?UTF-8?q?=D1=8B=20=D0=B8=D1=81=D0=BA=D0=BB=D1=8E=D1=87=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 2 ++ .../exception422_unprocessable_entity.cpp | 18 ++++++++++++++++++ .../exception422_unprocessable_entity.h | 16 ++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 src/exceptions/exception422_unprocessable_entity.cpp create mode 100644 src/exceptions/exception422_unprocessable_entity.h 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; +}; +}