user_data->event_type = type;
if (DATA_CONTROL_ERROR_NONE != result) {
- // According to native documentation only IOError can be returned to webapi, other errors are
- // handled earlier
- result_callback(handle, DATA_CONTROL_ERROR_IO_ERROR, 0, user_data.get());
+ LogAndReportError(ServiceNotAvailableException("AddChangeListener failed"), out,
+ ("AddChangeListener failed: %d (%s)", result, get_error_message(result)));
return;
}
user_data.get(), &watch_id);
if (DATA_CONTROL_ERROR_NONE != result) {
- // According to native documentation only IOError can be returned to webapi, other errors are
- // handled earlier
- result_callback(handle, DATA_CONTROL_ERROR_IO_ERROR, 0, user_data.get());
+ LogAndReportError(ServiceNotAvailableException("AddChangeListener failed"), out,
+ ("AddChangeListener failed: %d (%s)", result, get_error_message(result)));
return;
}