From 03cb2ec36282392d51c874b87af083a8112eff21 Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Tue, 8 Sep 2015 16:19:42 -0600 Subject: [PATCH] grovewfs: throw exception(s) on fatal errors Signed-off-by: Jon Trulson Signed-off-by: Mihai Tudor Panu --- src/grovewfs/grovewfs.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/grovewfs/grovewfs.cxx b/src/grovewfs/grovewfs.cxx index 69e63eb0..2eb70ac6 100644 --- a/src/grovewfs/grovewfs.cxx +++ b/src/grovewfs/grovewfs.cxx @@ -23,6 +23,8 @@ */ #include +#include +#include #include "grovewfs.h" @@ -33,7 +35,8 @@ GroveWFS::GroveWFS(int pin) { if ( !(m_gpio = mraa_gpio_init(pin)) ) { - cerr << __FUNCTION__ << ": mraa_gpio_init() failed" << endl; + throw std::invalid_argument(std::string(__FUNCTION__) + + ": mraa_gpio_init() failed, invalid pin?"); return; }