Use all phosphor-dbus-interfaces errors
Remove the local error definitions and use the
ones in phosphor-dbus-interfaces instead as the ones
there suit our purposes and it simplifies this repository
to do so.
Change-Id: I18428c496914153270ecb181e7193acd0e386e97
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/filedescriptor.cpp b/filedescriptor.cpp
index 9354d6e..6a4b898 100644
--- a/filedescriptor.cpp
+++ b/filedescriptor.cpp
@@ -15,15 +15,18 @@
*/
#include <stdexcept>
#include <unistd.h>
-#include "filedescriptor.hpp"
#include <phosphor-logging/elog.hpp>
-#include "elog-errors.hpp"
+#include <phosphor-logging/elog-errors.hpp>
+#include <xyz/openbmc_project/Common/File/error.hpp>
+#include "filedescriptor.hpp"
namespace openpower
{
namespace util
{
+namespace file_error = sdbusplus::xyz::openbmc_project::Common::File::Error;
+
FileDescriptor::FileDescriptor(const std::string& path)
{
using namespace phosphor::logging;
@@ -32,9 +35,11 @@
if (fd < 0)
{
- elog<org::open_power::Proc::CFAM::OpenFailure>(
- org::open_power::Proc::CFAM::OpenFailure::ERRNO(errno),
- org::open_power::Proc::CFAM::OpenFailure::PATH(path.c_str()));
+ using metadata = xyz::openbmc_project::Common::File::Open;
+
+ elog<file_error::Open>(
+ metadata::ERRNO(errno),
+ metadata::PATH(path.c_str()));
}
}