Добавлены структуры исключений

This commit is contained in:
Антон
2025-09-29 07:30:02 +03:00
parent 4eaf6ab2a1
commit 3db3778789
5 changed files with 72 additions and 0 deletions
+4
View File
@@ -48,6 +48,10 @@ add_executable(App ./src/main.cpp
./src/DAO/MemoryAuthDAO.cpp ./src/DAO/MemoryAuthDAO.cpp
./src/DAO/MemoryAuthDAO.h ./src/DAO/MemoryAuthDAO.h
./src/endpoints_handlers/AuthLogoutExecutor.h ./src/endpoints_handlers/AuthLogoutExecutor.h
./src/exceptions/exception400_bad_request.cpp
./src/exceptions/exception400_bad_request.h
./src/exceptions/exception409_conflict.cpp
./src/exceptions/exception409_conflict.h
) )
target_link_libraries(App PRIVATE Boost::boost Boost::json Threads::Threads mysql::concpp) target_link_libraries(App PRIVATE Boost::boost Boost::json Threads::Threads mysql::concpp)
@@ -0,0 +1,18 @@
#include "exception400_bad_request.h"
#include <boost/beast/core/error.hpp>
using namespace std;
using namespace std::literals;
namespace uad
{
exception400_bad_request::exception400_bad_request(const string& info): message_(info)
{
}
char const* exception400_bad_request::what() const
{
return message_.c_str();
}
}
+16
View File
@@ -0,0 +1,16 @@
#pragma once
#include <exception>
#include <string>
namespace uad
{
struct exception400_bad_request : std::exception
{
private:
std::string message_;
public:
exception400_bad_request(const std::string& info);
char const* what() const override;
};
}
+18
View File
@@ -0,0 +1,18 @@
#include "exception409_conflict.h"
#include <boost/beast/core/error.hpp>
using namespace std;
using namespace std::literals;
namespace uad
{
exception409_conflict::exception409_conflict(const string& info): message_(info)
{
}
char const* exception409_conflict::what() const
{
return message_.c_str();
}
}
+16
View File
@@ -0,0 +1,16 @@
#pragma once
#include <exception>
#include <string>
namespace uad
{
struct exception409_conflict : std::exception
{
private:
std::string message_;
public:
exception409_conflict(const std::string& info);
char const* what() const override;
};
}