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:
committed by
Brendan Le Foll
parent
14617d0f36
commit
65dc2e7ea3
@@ -135,5 +135,10 @@ class Spi;
|
|||||||
|
|
||||||
%init %{
|
%init %{
|
||||||
//Adding mraa_init() to the module initialisation process
|
//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");
|
||||||
|
}
|
||||||
%}
|
%}
|
||||||
|
|||||||
Reference in New Issue
Block a user