mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
enc03r: 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
2f2b502813
commit
9e3c72a547
@ -23,6 +23,8 @@
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
|
||||
#include "enc03r.h"
|
||||
|
||||
@ -35,7 +37,8 @@ ENC03R::ENC03R(int pin, float vref)
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user