Revert "dbus_rest: return error response with not found when bad dbus request"
This reverts commit b623d9c1b6605978eb6158619bb43c79a9f543fd.
Fixes #206
There are conditions where the mapper apparently replies with errors.
While this is obviously wrong, it causes a user facing regression in
firmware updates, which is documented in #206. This change is likely
just fine in isolation, but someone will need to resolve the mapper
issue before we can re-merge this.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I59843b6cc001a81e68b4f82da922b7eb2611ca29
diff --git a/include/openbmc_dbus_rest.hpp b/include/openbmc_dbus_rest.hpp
index 19c462f..b988095 100644
--- a/include/openbmc_dbus_rest.hpp
+++ b/include/openbmc_dbus_rest.hpp
@@ -1698,34 +1698,34 @@
{
BMCWEB_LOG_ERROR << "Bad dbus request error: "
<< ec2;
- setErrorResponse(
- asyncResp->res,
- boost::beast::http::status::not_found,
- notFoundDesc, notFoundMsg);
- return;
- }
- nlohmann::json properties;
- int r = convertDBusToJSON("a{sv}", msg, properties);
- if (r < 0)
- {
- BMCWEB_LOG_ERROR << "convertDBusToJSON failed";
}
else
{
- for (auto& prop : properties.items())
+ nlohmann::json properties;
+ int r =
+ convertDBusToJSON("a{sv}", msg, properties);
+ if (r < 0)
{
- // if property name is empty, or
- // matches our search query, add it
- // to the response json
+ BMCWEB_LOG_ERROR
+ << "convertDBusToJSON failed";
+ }
+ else
+ {
+ for (auto& prop : properties.items())
+ {
+ // if property name is empty, or
+ // matches our search query, add it
+ // to the response json
- if (propertyName->empty())
- {
- (*response)[prop.key()] =
- std::move(prop.value());
- }
- else if (prop.key() == *propertyName)
- {
- *response = std::move(prop.value());
+ if (propertyName->empty())
+ {
+ (*response)[prop.key()] =
+ std::move(prop.value());
+ }
+ else if (prop.key() == *propertyName)
+ {
+ *response = std::move(prop.value());
+ }
}
}
}