From f358b2e16d6e43c1d91ac039ae3a2521cd7382ea Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Fri, 11 Sep 2015 12:15:28 -0600 Subject: [PATCH] ta12200: throw exception(s) on fatal errors Signed-off-by: Jon Trulson Signed-off-by: Mihai Tudor Panu --- src/ta12200/ta12200.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ta12200/ta12200.cxx b/src/ta12200/ta12200.cxx index 136b3001..f9d3cb07 100644 --- a/src/ta12200/ta12200.cxx +++ b/src/ta12200/ta12200.cxx @@ -23,6 +23,8 @@ */ #include +#include +#include #include "ta12200.h" @@ -35,7 +37,8 @@ TA12200::TA12200(int pin) if ( !(m_aio = mraa_aio_init(pin)) ) { - cerr << __FUNCTION__ << ": mraa_aio_init() failed" << endl; + throw std::invalid_argument(std::string(__FUNCTION__) + + ": mraa_aio_init() failed, invalid pin?"); return; } }