мелкие правки

This commit is contained in:
Антон
2025-10-04 09:54:55 +03:00
parent 2b5e601387
commit 5346bb2849
13 changed files with 51 additions and 158 deletions
@@ -1,18 +0,0 @@
#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
@@ -1,16 +0,0 @@
#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
@@ -1,18 +0,0 @@
#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
@@ -1,16 +0,0 @@
#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;
};
}
@@ -1,18 +0,0 @@
#include "exception422_unprocessable_entity.h"
#include <boost/beast/core/error.hpp>
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();
}
}
@@ -1,16 +0,0 @@
#pragma once
#include <exception>
#include <string>
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;
};
}
+11
View File
@@ -0,0 +1,11 @@
#include "session_exception.h"
using namespace std;
namespace uad
{
char const* session_exception::what() const
{
return message.c_str();
}
}
+20
View File
@@ -0,0 +1,20 @@
#pragma once
#include <boost/beast/http/status.hpp>
#include <string>
#include <boost/exception/to_string.hpp>
namespace uad
{
struct session_exception : std::exception
{
const boost::beast::http::status code;
const std::string comment;
const std::string message;
session_exception(const boost::beast::http::status ec, const std::string info)
: code(ec), comment(info), message(std::to_string(static_cast<uint64_t>(ec)) + " - " + comment)
{}
char const* what() const override;
};
}