{}
);
if (native_.isFailure(result)) {
- throw new WebAPIException(0, result.error.message,
- result.error.name);
+ throw native_.getErrorObject(result);
}
// If NFC is supported then return new NFCAdapter instance
{name: 'exclusiveMode', type: types_.BOOLEAN}
]);
- var result = native_.callSync(
- 'NFCManager_setExclusiveMode',
- { 'exclusiveMode': args.exclusiveMode}
- );
+ var result = native_.callSync('NFCManager_setExclusiveMode', {
+ exclusiveMode: args.exclusiveMode
+ });
- // If failed then exception should be thrown.
if (native_.isFailure(result)) {
- throw new WebAPIException(0, result.error.message,
- result.error.name);
- // Uncoment line below (and remove line above) when problem
- // with error conversion is fixed:
- //
- //throw native_.getErrorObject(result);
+ throw native_.getErrorObject(result);
}
- // Otherwise just return
- return;
};
//////////////////NFCAdapter /////////////////
var result = native_.callSync(
'NFCAdapter_addCardEmulationModeChangeListener');
if (native_.isFailure(result)) {
- throw new WebAPIException(0, result.error.message,
- result.error.name);
+ throw native_.getErrorObject(result);
}
}
result = native_.callSync('NFCAdapter_addTransactionEventListener', {
type: args.type});
if (native_.isFailure(result)) {
- throw new WebAPIException(0, result.error.message,
- result.error.name);
+ throw native_.getErrorObject(result);
}
}
return transactionEventListenerEse.addListener(args.callback);
result = native_.callSync('NFCAdapter_addTransactionEventListener', {
type: args.type});
if (native_.isFailure(result)) {
- throw new WebAPIException(0, result.error.message,
- result.error.name);
+ throw native_.getErrorObject(result);
}
}
return transactionEventListenerUicc.addListener(args.callback);
var result = native_.callSync(
'NFCAdapter_addActiveSecureElementChangeListener');
if (native_.isFailure(result)) {
- throw new WebAPIException(0, result.error.message,
- result.error.name);
+ throw native_.getErrorObject(result);
}
}
if (type_.isEmptyObject(HCEEventListener.listeners)) {
var result = native_.callSync('NFCAdapter_addHCEEventListener');
if (native_.isFailure(result)) {
- throw new WebAPIException(0, result.error.message, result.error.name);
+ throw native_.getErrorObject(result);
}
}
if (type_.isEmptyObject(HCEEventListener.listeners)) {
var result = native_.callSync('NFCAdapter_removeHCEEventListener');
if (native_.isFailure(result)) {
- throw new WebAPIException(0, result.error.message, result.error.name);
+ throw native_.getErrorObject(result);
}
}
};
var callback = function(result) {
if (native_.isFailure(result)) {
- native_.callIfPossible(args.errorCallback, new WebAPIException(0, result.error.message,
- result.error.name));
+ native_.callIfPossible(args.errorCallback, native_.getErrorObject(result));
return;
}
native_.callIfPossible(args.successCallback);
var result = native_.callSync('NFCAdapter_isActivatedHandlerForAID', data);
if (native_.isFailure(result)) {
- throw new WebAPIException(0, result.error.message, result.error.name);
+ throw native_.getErrorObject(result);
}
return native_.getResultObject(result);
};
var result = native_.callSync('NFCAdapter_isActivatedHandlerForCategory', data);
if (native_.isFailure(result)) {
- throw new WebAPIException(0, result.error.message, result.error.name);
+ throw native_.getErrorObject(result);
}
return native_.getResultObject(result);
};
var result = native_.callSync('NFCAdapter_registerAID', data);
if (native_.isFailure(result)) {
- throw new WebAPIException(0, result.error.message, result.error.name);
+ throw native_.getErrorObject(result);
}
};
var result = native_.callSync('NFCAdapter_unregisterAID', data);
if (native_.isFailure(result)) {
- throw new WebAPIException(0, result.error.message, result.error.name);
+ throw native_.getErrorObject(result);
}
};
var callback = function(result) {
if (native_.isFailure(result)) {
- native_.callIfPossible(args.errorCallback, new WebAPIException(0, result.error.message,
- result.error.name));
+ native_.callIfPossible(args.errorCallback, native_.getErrorObject(result));
return;
}
var aids = [];
}
);
if (native_.isFailure(result)) {
- throw new WebAPIException(0, result.error.message,
- result.error.name);
- // throw native_.getErrorObject(result);
+ throw native_.getErrorObject(result);
}
tnf_ = converter_.toLong(result.result.tnf);
typ_ = toByteArray(result.result.type, 255);
}
);
if (native_.isFailure(result)) {
- throw new WebAPIException(0, result.error.message,
- result.error.name);
- // throw native_.getErrorObject(result);
+ throw native_.getErrorObject(result);
}
tizen.NDEFRecord.call(this, result.result.tnf, result.result.type,
result.result.payload, result.result.id);
}
);
if (native_.isFailure(result)) {
- throw new WebAPIException(0, result.error.message,
- result.error.name);
- // throw native_.getErrorObject(result);
+ throw native_.getErrorObject(result);
}
tizen.NDEFRecord.call(this, result.result.tnf, result.result.type,
result.result.payload, result.result.id);
}
);
if (native_.isFailure(result)) {
- throw new WebAPIException(0, result.error.message,
- result.error.name);
- // throw native_.getErrorObject(result);
+ throw native_.getErrorObject(result);
}
tizen.NDEFRecord.call(this, result.result.tnf, result.result.type,
result.result.payload, result.result.id);