From 5e7e2dc585dc7a7e62d2b648b541e7f50c39ea5d Mon Sep 17 00:00:00 2001 From: Ed Tanous Date: Thu, 16 Feb 2023 10:37:01 -0800 Subject: Take boost error_code by reference By convention, we should be following boost here, and passing error_code by reference, not by value. This makes our code consistent, and removes the need for a copy in some cases. Signed-off-by: Ed Tanous Change-Id: Id42ea4a90b6685a84818b87d1506c11256b3b9ae --- COMMON_ERRORS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'COMMON_ERRORS.md') diff --git a/COMMON_ERRORS.md b/COMMON_ERRORS.md index aa4b042654..70c09e3476 100644 --- a/COMMON_ERRORS.md +++ b/COMMON_ERRORS.md @@ -210,7 +210,7 @@ whole. BMCWEB_ROUTE("/myendpoint/", [](Request& req, Response& res, const std::string& id){ crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec, + [asyncResp](const boost::system::error_code& ec, const std::string& myProperty) { if (ec) { @@ -242,7 +242,7 @@ An implementation of the above that handles 404 would look like: BMCWEB_ROUTE("/myendpoint/", [](Request& req, Response& res, const std::string& id){ crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec, + [asyncResp](const boost::system::error_code& ec, const std::string& myProperty) { if (ec == ){ messages::resourceNotFound(res); -- cgit v1.2.3