ISysteminfoPtr Systeminfos(SysteminfoFactory::getInstance().getSysteminfos());
JSSysteminfoPriv* priv = new JSSysteminfoPriv(context, Systeminfos);
if (!JSObjectSetPrivate(object, static_cast<void*>(priv))) {
- LogError("Object can't store private data.");
+ LoggerE("Object can't store private data.");
delete priv;
}
- LogDebug("JSSysteminfo::initialize ");
+ LoggerD("JSSysteminfo::initialize ");
} else {
- LogDebug("Private object already set.");
+ LoggerD("Private object already set.");
}
}
JSSysteminfoPriv* priv = static_cast<JSSysteminfoPriv*>(JSObjectGetPrivate(object));
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting gallery");
+ LoggerD("Deleting gallery");
delete priv;
}
Validator check(context, exception);
if (!priv) {
- LogError("private object is null");
+ LoggerE("private object is null");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type missmatch error");
}
Try
std::string property;
if (!priv) {
- LogError("private object is null");
+ LoggerE("private object is null");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Wrong Object");
}
if (argumentCount < 2) {
if (argumentCount == 3) {
if (check.isCallback(arguments[2])) {
onErrorForCbm = arguments[2];
- } else if (!JSValueIsNull(context, arguments[2]) && !JSValueIsUndefined(context, arguments[2])) {
+ } else if (!JSValueIsNull(context, arguments[2])) {
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type missmatch error");
}
}
Try {
ISysteminfoPtr Systeminfos(priv->getObject());
+ BasePropertyPtr baseProperty = Systeminfos->getBasePropertyPtr(priv->getContext(), arguments[0]);
EventGetSysteminfoPtr event(new EventGetSysteminfo());
- event->setBasePropertyPtr(Systeminfos->getBasePropertyPtr(priv->getContext(), arguments[0]));
+ event->setBasePropertyPtr(baseProperty);
TIME_TRACER_ITEM_BEGIN(event->getProperty(), 0);
event->setPrivateData(StaticPointerCast<IEventPrivateData>(cbm));
return JSValueMakeUndefined(context);
}
- Catch(WrtDeviceApis::Commons::PendingOperationException) {
- cbm->callOnError(JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::UNKNOWN_ERROR, "Unknown error"));
- }
Catch(WrtDeviceApis::Commons::ConversionException) {
- cbm->callOnError(JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::TYPE_MISMATCH_ERROR, "Type missmatch error"));
- }
- Catch(WrtDeviceApis::Commons::InvalidArgumentException){
- cbm->callOnError(JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::INVALID_VALUES_ERROR, "Invalid values error"));
+ return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type missmatch error");
}
Catch(WrtDeviceApis::Commons::Exception) {
cbm->callOnError(JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::UNKNOWN_ERROR, "Unknown error"));
Validator check(context, exception);
if (!priv) {
- LogError("private object is null");
+ LoggerE("private object is null");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Wrong Object");
}
if (argumentCount < 2) {
option.timeout = converter.toULong(JSUtils::getJSProperty(context, arguments[2], "timeout", exception));
option.highThreshold = converter.toDouble(JSUtils::getJSProperty(context, arguments[2], "highThreshold", exception));
option.lowThreshold = converter.toDouble(JSUtils::getJSProperty(context, arguments[2], "lowThreshold", exception));
- } else if (!JSValueIsNull(context, arguments[2]) && !JSValueIsUndefined(context, arguments[2])) {
+ } else if (!JSValueIsNull(context, arguments[2])) {
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type missmatch error");
}
}
ISysteminfoPtr Systeminfos(priv->getObject());
+ BasePropertyPtr baseProperty = Systeminfos->getBasePropertyPtr(priv->getContext(), arguments[0]);
EventWatchSysteminfoPtr event(new EventWatchSysteminfo);
event->setWatchOption(option);
- event->setBasePropertyPtr(Systeminfos->getBasePropertyPtr(priv->getContext(), arguments[0]));
+ event->setBasePropertyPtr(baseProperty);
event->setPrivateData(StaticPointerCast<IEventPrivateData>(cbm));
SysteminfoListener& listener = SysteminfoListener::getInstance();
event->setForAsynchronousCall(&listener);
Systeminfos->watch(event);
- LogDebug("event->getId()" << event->getId());
+ LoggerD("event->getId()" << event->getId());
SysteminfoListenerCancellerPtr canceller = SysteminfoListenerCancellerPtr(new SysteminfoListenerCanceller(priv->getContext(), thisObject, event->getId()));
DeviceAPI::Common::IListenerItemPtr listenerItem = DPL::StaticPointerCast<DeviceAPI::Common::IListenerItem>(canceller);
}
Catch(WrtDeviceApis::Commons::ConversionException) {
- return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid values error");
+ return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type missmatch error");
}
Catch(WrtDeviceApis::Commons::InvalidArgumentException) {
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid values error");
Converter converter(context);
if (!priv) {
- LogError("private object is null");
+ LoggerE("private object is null");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Wrong Object");
}
if (argumentCount < 1) {
ISysteminfoPtr Systeminfos(priv->getObject());
id = static_cast<long>(converter.toLong(arguments[0]));
- LogDebug("clearWatch id = " << id );
+ LoggerD("clearWatch id = " << id );
Systeminfos->clearWatch(id);
SysteminfoListenerCancellerPtr canceller = SysteminfoListenerCancellerPtr(new SysteminfoListenerCanceller(priv->getContext(), thisObject, id));