База для ручки PostUserMedicationsExecutor.h

This commit is contained in:
2026-01-08 12:20:51 +03:00
parent 8657b2910b
commit 50bad13f86
3 changed files with 9 additions and 7 deletions
@@ -46,7 +46,7 @@ public:
if (req[http::field::authorization].size() <= auth_prefix.size()) if (req[http::field::authorization].size() <= auth_prefix.size())
{ {
BOOST_LOG_TRIVIAL(info) << invalid_token_message; BOOST_LOG_TRIVIAL(error) << invalid_token_message;
throw session_exception(http::status::unauthorized, "Unauthorized"); throw session_exception(http::status::unauthorized, "Unauthorized");
} }
@@ -54,7 +54,7 @@ public:
if (!auth_dao_->HasAuthorized(auth_token)) if (!auth_dao_->HasAuthorized(auth_token))
{ {
BOOST_LOG_TRIVIAL(info) << invalid_token_message; BOOST_LOG_TRIVIAL(error) << invalid_token_message;
throw session_exception(http::status::unauthorized, "Unauthorized"); throw session_exception(http::status::unauthorized, "Unauthorized");
} }
@@ -46,7 +46,7 @@ public:
if (req[http::field::authorization].size() <= auth_prefix.size()) if (req[http::field::authorization].size() <= auth_prefix.size())
{ {
BOOST_LOG_TRIVIAL(info) << invalid_token_message; BOOST_LOG_TRIVIAL(error) << invalid_token_message;
throw session_exception(http::status::unauthorized, "Unauthorized"); throw session_exception(http::status::unauthorized, "Unauthorized");
} }
@@ -54,7 +54,7 @@ public:
if (!auth_dao_->HasAuthorized(auth_token)) if (!auth_dao_->HasAuthorized(auth_token))
{ {
BOOST_LOG_TRIVIAL(info) << invalid_token_message; BOOST_LOG_TRIVIAL(error) << invalid_token_message;
throw session_exception(http::status::unauthorized, "Unauthorized"); throw session_exception(http::status::unauthorized, "Unauthorized");
} }
+3 -1
View File
@@ -15,8 +15,10 @@ void InitLogs()
logging::keywords::rotation_size = 10 * 1024 * 1024, logging::keywords::rotation_size = 10 * 1024 * 1024,
logging::keywords::time_based_rotation = logging::keywords::time_based_rotation =
logging::sinks::file::rotation_at_time_point(0, 0, 0), logging::sinks::file::rotation_at_time_point(0, 0, 0),
logging::keywords::format = "[%TimeStamp%] [%Severity%]: %Message%" logging::keywords::format =
"[%TimeStamp%] [%Severity%]: %Message%"
); );
logging::add_common_attributes(); logging::add_common_attributes();
} }
} }