generated from Sithas/conan_template
Добавлены структуры исключений
This commit is contained in:
@@ -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();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -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();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user