mirror of
https://github.com/eclipse/upm.git
synced 2025-03-14 20:47:30 +03:00

Signed-off-by: Stefan Andritoiu <stefan.andritoiu@intel.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
22 lines
673 B
OpenEdge ABL
22 lines
673 B
OpenEdge ABL
/* -----------------------------------------------------------------------------
|
|
* java_exceptions.i
|
|
*
|
|
* SWIG library file providing java-specific exception handling in the upm library
|
|
* ----------------------------------------------------------------------------- */
|
|
|
|
/*
|
|
* Use this macro for functions that read data from a sensor and throw a
|
|
* std::runtime_error in case of a read failure
|
|
*/
|
|
%define READDATA_EXCEPTION(function)
|
|
%javaexception("java.io.IOException") function {
|
|
try {
|
|
$action
|
|
} catch (std::runtime_error &e) {
|
|
jclass clazz = jenv->FindClass("java/io/IOException");
|
|
jenv->ThrowNew(clazz, e.what());
|
|
return $null;
|
|
}
|
|
}
|
|
%enddef
|