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 <edtanous@google.com>
Change-Id: Id42ea4a90b6685a84818b87d1506c11256b3b9ae
diff --git a/include/openbmc_dbus_rest.hpp b/include/openbmc_dbus_rest.hpp
index 3035105..98dfb84 100644
--- a/include/openbmc_dbus_rest.hpp
+++ b/include/openbmc_dbus_rest.hpp
@@ -131,7 +131,7 @@
     crow::connections::systemBus->async_method_call(
         [transaction, processName{std::string(processName)},
          objectPath{std::string(objectPath)}](
-            const boost::system::error_code ec,
+            const boost::system::error_code& ec,
             const std::string& introspectXml) {
         if (ec)
         {
@@ -192,7 +192,7 @@
     sdbusplus::asio::getAllProperties(
         *crow::connections::systemBus, service, objectPath, interface,
         [asyncResp, objectPath, service,
-         interface](const boost::system::error_code ec,
+         interface](const boost::system::error_code& ec,
                     const dbus::utility::DBusPropertiesMap& propertiesList) {
         if (ec)
         {
@@ -305,7 +305,7 @@
                      << " connection_name " << connectionName;
     crow::connections::systemBus->async_method_call(
         [transaction, objectName,
-         connectionName](const boost::system::error_code ec,
+         connectionName](const boost::system::error_code& ec,
                          const dbus::utility::ManagedObjectType& objects) {
         if (ec)
         {
@@ -375,7 +375,7 @@
                      << " on connection:" << connectionName;
     crow::connections::systemBus->async_method_call(
         [transaction, objectName, connectionName](
-            const boost::system::error_code ec,
+            const boost::system::error_code& ec,
             const dbus::utility::MapperGetAncestorsResponse& objects) {
         if (ec)
         {
@@ -1383,7 +1383,7 @@
                      << connectionName;
     crow::connections::systemBus->async_method_call(
         [transaction, connectionName{std::string(connectionName)}](
-            const boost::system::error_code ec,
+            const boost::system::error_code& ec,
             const std::string& introspectXml) {
         BMCWEB_LOG_DEBUG << "got xml:\n " << introspectXml;
         if (ec)
@@ -1495,7 +1495,7 @@
                         crow::connections::systemBus->async_send(
                             m,
                             [transaction,
-                             returnType](boost::system::error_code ec2,
+                             returnType](const boost::system::error_code& ec2,
                                          sdbusplus::message_t& m2) {
                             if (ec2)
                             {
@@ -1747,7 +1747,7 @@
                 m.append(interface);
                 crow::connections::systemBus->async_send(
                     m, [asyncResp, response,
-                        propertyName](const boost::system::error_code ec2,
+                        propertyName](const boost::system::error_code& ec2,
                                       sdbusplus::message_t& msg) {
                         if (ec2)
                         {
@@ -1900,7 +1900,7 @@
 
             crow::connections::systemBus->async_method_call(
                 [connectionName{std::string(connectionName)},
-                 transaction](const boost::system::error_code ec3,
+                 transaction](const boost::system::error_code& ec3,
                               const std::string& introspectXml) {
                 if (ec3)
                 {
@@ -1984,8 +1984,9 @@
                                 }
                                 crow::connections::systemBus->async_send(
                                     m,
-                                    [transaction](boost::system::error_code ec,
-                                                  sdbusplus::message_t& m2) {
+                                    [transaction](
+                                        const boost::system::error_code& ec,
+                                        sdbusplus::message_t& m2) {
                                     BMCWEB_LOG_DEBUG << "sent";
                                     if (ec)
                                     {
@@ -2157,7 +2158,7 @@
     {
         crow::connections::systemBus->async_method_call(
             [asyncResp, processName,
-             objectPath](const boost::system::error_code ec,
+             objectPath](const boost::system::error_code& ec,
                          const std::string& introspectXml) {
             if (ec)
             {
@@ -2212,7 +2213,7 @@
     {
         crow::connections::systemBus->async_method_call(
             [asyncResp, processName, objectPath,
-             interfaceName](const boost::system::error_code ec,
+             interfaceName](const boost::system::error_code& ec,
                             const std::string& introspectXml) {
             if (ec)
             {
@@ -2445,7 +2446,7 @@
         .methods(boost::beast::http::verb::get)(
             [](const crow::Request&,
                const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
-        auto myCallback = [asyncResp](const boost::system::error_code ec,
+        auto myCallback = [asyncResp](const boost::system::error_code& ec,
                                       std::vector<std::string>& names) {
             if (ec)
             {