diff options
| author | Matt Spinler <spinler@us.ibm.com> | 2018-12-06 14:08:27 -0600 |
|---|---|---|
| committer | Ed Tanous <ed.tanous@intel.com> | 2018-12-13 21:55:44 +0000 |
| commit | d6091dddfa28afa5fda0bf4175a009d70bfa309a (patch) | |
| tree | c2ca69292df00bd8f7d7e48fc578392eb26dc5a7 /include | |
| parent | dc2f9f11e726c02667e1c35080b15b20a4e62b33 (diff) | |
| download | bmcweb-d6091dddfa28afa5fda0bf4175a009d70bfa309a.tar.gz bmcweb-d6091dddfa28afa5fda0bf4175a009d70bfa309a.zip | |
REST: For list, return the error in JSON
The only way list can fail is if the GetSubTreePaths call fails,
and that will only happen if the path isn't a valid D-Bus object.
In that case, return the standard REST error JSON response for
org.freedesktop.DBus.Error.FileNotFound.
Change-Id: I538d3132552590e51f9ede80762aee00c59cb3e9
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/openbmc_dbus_rest.hpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/openbmc_dbus_rest.hpp b/include/openbmc_dbus_rest.hpp index 0ab3908..a142426 100644 --- a/include/openbmc_dbus_rest.hpp +++ b/include/openbmc_dbus_rest.hpp @@ -929,7 +929,8 @@ void handleList(crow::Response &res, const std::string &objectPath, std::vector<std::string> &objectPaths) { if (ec) { - res.result(boost::beast::http::status::internal_server_error); + setErrorResponse(res, boost::beast::http::status::not_found, + notFoundDesc, notFoundMsg); } else { |

