summaryrefslogtreecommitdiffstats
path: root/proc_control.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'proc_control.cpp')
-rw-r--r--proc_control.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/proc_control.cpp b/proc_control.cpp
index 10c3ffa..a86b354 100644
--- a/proc_control.cpp
+++ b/proc_control.cpp
@@ -17,7 +17,9 @@
#include <functional>
#include <iostream>
#include <phosphor-logging/log.hpp>
+#include <phosphor-logging/elog.hpp>
#include "registration.hpp"
+#include "elog-errors.hpp"
using namespace openpower::util;
@@ -34,6 +36,7 @@ void usage(char** argv, const ProcedureMap& procedures)
int main(int argc, char** argv)
{
+ using namespace phosphor::logging;
const ProcedureMap& procedures = Registration::getProcedures();
if (argc != 2)
@@ -56,10 +59,24 @@ int main(int argc, char** argv)
{
procedure->second();
}
- catch (std::exception& e)
+ catch (org::open_power::Proc::CFAM::SeekFailure& e)
{
- //TODO: commit an actual error that does a callout
- phosphor::logging::log<phosphor::logging::level::ERR>(e.what());
+ commit<org::open_power::Proc::CFAM::SeekFailure>();
+ return -1;
+ }
+ catch (org::open_power::Proc::CFAM::OpenFailure& e)
+ {
+ commit<org::open_power::Proc::CFAM::OpenFailure>();
+ return -1;
+ }
+ catch (org::open_power::Proc::CFAM::WriteFailure& e)
+ {
+ commit<org::open_power::Proc::CFAM::WriteFailure>();
+ return -1;
+ }
+ catch (org::open_power::Proc::CFAM::ReadFailure& e)
+ {
+ commit<org::open_power::Proc::CFAM::ReadFailure>();
return -1;
}
OpenPOWER on IntegriCloud