mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
grovelinefinder: throw exception(s) on fatal errors
Signed-off-by: Jon Trulson <jtrulson@ics.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
parent
88c11fb1cf
commit
9081c35f53
@ -23,6 +23,8 @@
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
|
||||
#include "grovelinefinder.h"
|
||||
|
||||
@ -33,7 +35,8 @@ GroveLineFinder::GroveLineFinder(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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user