diff options
Diffstat (limited to 'redfish-core/src/error_messages.cpp')
-rw-r--r-- | redfish-core/src/error_messages.cpp | 61 |
1 files changed, 35 insertions, 26 deletions
diff --git a/redfish-core/src/error_messages.cpp b/redfish-core/src/error_messages.cpp index 7b0251562d..87293833fc 100644 --- a/redfish-core/src/error_messages.cpp +++ b/redfish-core/src/error_messages.cpp @@ -22,7 +22,7 @@ #include <boost/beast/http/field.hpp> #include <boost/beast/http/status.hpp> -#include <boost/url/url_view.hpp> +#include <boost/url/url_view_base.hpp> #include <nlohmann/json.hpp> #include <array> @@ -206,13 +206,14 @@ void malformedJSON(crow::Response& res) * See header file for more information * @endinternal */ -nlohmann::json resourceMissingAtURI(boost::urls::url_view arg1) +nlohmann::json resourceMissingAtURI(const boost::urls::url_view_base& arg1) { std::array<std::string_view, 1> args{arg1.buffer()}; return getLog(redfish::registries::base::Index::resourceMissingAtURI, args); } -void resourceMissingAtURI(crow::Response& res, boost::urls::url_view arg1) +void resourceMissingAtURI(crow::Response& res, + const boost::urls::url_view_base& arg1) { res.result(boost::beast::http::status::bad_request); addMessageToErrorJson(res.jsonValue, resourceMissingAtURI(arg1)); @@ -317,14 +318,15 @@ void unrecognizedRequestBody(crow::Response& res) * See header file for more information * @endinternal */ -nlohmann::json resourceAtUriUnauthorized(boost::urls::url_view arg1, +nlohmann::json resourceAtUriUnauthorized(const boost::urls::url_view_base& arg1, std::string_view arg2) { return getLog(redfish::registries::base::Index::resourceAtUriUnauthorized, std::to_array<std::string_view>({arg1.buffer(), arg2})); } -void resourceAtUriUnauthorized(crow::Response& res, boost::urls::url_view arg1, +void resourceAtUriUnauthorized(crow::Response& res, + const boost::urls::url_view_base& arg1, std::string_view arg2) { res.result(boost::beast::http::status::unauthorized); @@ -554,7 +556,8 @@ void propertyValueOutOfRange(crow::Response& res, const nlohmann::json& arg1, * See header file for more information * @endinternal */ -nlohmann::json resourceAtUriInUnknownFormat(boost::urls::url_view arg1) +nlohmann::json + resourceAtUriInUnknownFormat(const boost::urls::url_view_base& arg1) { return getLog( redfish::registries::base::Index::resourceAtUriInUnknownFormat, @@ -562,7 +565,7 @@ nlohmann::json resourceAtUriInUnknownFormat(boost::urls::url_view arg1) } void resourceAtUriInUnknownFormat(crow::Response& res, - boost::urls::url_view arg1) + const boost::urls::url_view_base& arg1) { res.result(boost::beast::http::status::bad_request); addMessageToErrorJson(res.jsonValue, resourceAtUriInUnknownFormat(arg1)); @@ -729,13 +732,14 @@ void resourceTypeIncompatible(crow::Response& res, std::string_view arg1, * See header file for more information * @endinternal */ -nlohmann::json resetRequired(boost::urls::url_view arg1, std::string_view arg2) +nlohmann::json resetRequired(const boost::urls::url_view_base& arg1, + std::string_view arg2) { return getLog(redfish::registries::base::Index::resetRequired, std::to_array<std::string_view>({arg1.buffer(), arg2})); } -void resetRequired(crow::Response& res, boost::urls::url_view arg1, +void resetRequired(crow::Response& res, const boost::urls::url_view_base& arg1, std::string_view arg2) { res.result(boost::beast::http::status::bad_request); @@ -809,9 +813,10 @@ void propertyValueConflict(crow::Response& res, std::string_view arg1, * See header file for more information * @endinternal */ -nlohmann::json propertyValueResourceConflict(std::string_view arg1, - const nlohmann::json& arg2, - boost::urls::url_view arg3) +nlohmann::json + propertyValueResourceConflict(std::string_view arg1, + const nlohmann::json& arg2, + const boost::urls::url_view_base& arg3) { std::string arg2Str = arg2.dump(2, ' ', true, nlohmann::json::error_handler_t::replace); @@ -823,7 +828,7 @@ nlohmann::json propertyValueResourceConflict(std::string_view arg1, void propertyValueResourceConflict(crow::Response& res, std::string_view arg1, const nlohmann::json& arg2, - boost::urls::url_view arg3) + const boost::urls::url_view_base& arg3) { res.result(boost::beast::http::status::conflict); addMessageToErrorJson(res.jsonValue, @@ -886,13 +891,14 @@ void propertyValueIncorrect(crow::Response& res, std::string_view arg1, * See header file for more information * @endinternal */ -nlohmann::json resourceCreationConflict(boost::urls::url_view arg1) +nlohmann::json resourceCreationConflict(const boost::urls::url_view_base& arg1) { return getLog(redfish::registries::base::Index::resourceCreationConflict, std::to_array<std::string_view>({arg1.buffer()})); } -void resourceCreationConflict(crow::Response& res, boost::urls::url_view arg1) +void resourceCreationConflict(crow::Response& res, + const boost::urls::url_view_base& arg1) { res.result(boost::beast::http::status::bad_request); addMessageToErrorJson(res.jsonValue, resourceCreationConflict(arg1)); @@ -1039,14 +1045,15 @@ void resourceNotFound(crow::Response& res, std::string_view arg1, * See header file for more information * @endinternal */ -nlohmann::json couldNotEstablishConnection(boost::urls::url_view arg1) +nlohmann::json + couldNotEstablishConnection(const boost::urls::url_view_base& arg1) { return getLog(redfish::registries::base::Index::couldNotEstablishConnection, std::to_array<std::string_view>({arg1.buffer()})); } void couldNotEstablishConnection(crow::Response& res, - boost::urls::url_view arg1) + const boost::urls::url_view_base& arg1) { res.result(boost::beast::http::status::not_found); addMessageToErrorJson(res.jsonValue, couldNotEstablishConnection(arg1)); @@ -1166,8 +1173,9 @@ void actionParameterNotSupported(crow::Response& res, std::string_view arg1, * See header file for more information * @endinternal */ -nlohmann::json sourceDoesNotSupportProtocol(boost::urls::url_view arg1, - std::string_view arg2) +nlohmann::json + sourceDoesNotSupportProtocol(const boost::urls::url_view_base& arg1, + std::string_view arg2) { return getLog( redfish::registries::base::Index::sourceDoesNotSupportProtocol, @@ -1175,7 +1183,7 @@ nlohmann::json sourceDoesNotSupportProtocol(boost::urls::url_view arg1, } void sourceDoesNotSupportProtocol(crow::Response& res, - boost::urls::url_view arg1, + const boost::urls::url_view_base& arg1, std::string_view arg2) { res.result(boost::beast::http::status::bad_request); @@ -1227,13 +1235,13 @@ void accountRemoved(crow::Response& res) * See header file for more information * @endinternal */ -nlohmann::json accessDenied(boost::urls::url_view arg1) +nlohmann::json accessDenied(const boost::urls::url_view_base& arg1) { return getLog(redfish::registries::base::Index::accessDenied, std::to_array<std::string_view>({arg1.buffer()})); } -void accessDenied(crow::Response& res, boost::urls::url_view arg1) +void accessDenied(crow::Response& res, const boost::urls::url_view_base& arg1) { res.result(boost::beast::http::status::forbidden); addMessageToErrorJson(res.jsonValue, accessDenied(arg1)); @@ -1394,13 +1402,13 @@ void noValidSession(crow::Response& res) * See header file for more information * @endinternal */ -nlohmann::json invalidObject(boost::urls::url_view arg1) +nlohmann::json invalidObject(const boost::urls::url_view_base& arg1) { return getLog(redfish::registries::base::Index::invalidObject, std::to_array<std::string_view>({arg1.buffer()})); } -void invalidObject(crow::Response& res, boost::urls::url_view arg1) +void invalidObject(crow::Response& res, const boost::urls::url_view_base& arg1) { res.result(boost::beast::http::status::bad_request); addMessageToErrorJson(res.jsonValue, invalidObject(arg1)); @@ -1771,7 +1779,7 @@ void queryParameterOutOfRange(crow::Response& res, std::string_view arg1, queryParameterOutOfRange(arg1, arg2, arg3)); } -nlohmann::json passwordChangeRequired(boost::urls::url_view arg1) +nlohmann::json passwordChangeRequired(const boost::urls::url_view_base& arg1) { return getLog(redfish::registries::base::Index::passwordChangeRequired, std::to_array<std::string_view>({arg1.buffer()})); @@ -1784,7 +1792,8 @@ nlohmann::json passwordChangeRequired(boost::urls::url_view arg1) * See header file for more information * @endinternal */ -void passwordChangeRequired(crow::Response& res, boost::urls::url_view arg1) +void passwordChangeRequired(crow::Response& res, + const boost::urls::url_view_base& arg1) { messages::addMessageToJsonRoot(res.jsonValue, passwordChangeRequired(arg1)); } |