Private
Public Access
2
0

javascript: Print message on stderr if mraa_init() fails

We should throw exception but SWIG_Error causes a seg fault.
We should use syslog instead of stderr but syslog.h is not swigable

Signed-off-by: Henry Bruce <henry.bruce@intel.com>
This commit is contained in:
Henry Bruce
2016-03-01 13:37:46 -08:00
committed by Brendan Le Foll
parent 14617d0f36
commit 65dc2e7ea3

View File

@@ -135,5 +135,10 @@ class Spi;
%init %{
//Adding mraa_init() to the module initialisation process
mraa_init();
if (mraa_init() != MRAA_SUCCESS) {
// FIXME: Figure out why SWIG_Error causes seg fault.
// Warn on stderr for time being
// SWIG_Error(SWIG_RuntimeError, "mraa_init() failed");
fprintf(stderr, "Javascript Runtime Error: mraa_init() failed.\n");
}
%}