From: Andrzej Popowski Date: Thu, 30 Apr 2015 09:42:08 +0000 (+0200) Subject: [push] - handling errors of push_register core function X-Git-Tag: submit/tizen_tv/20150603.064601~1^2~110 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5f39a1759a6ee5a274a8db486fd998a10bc4a1c2;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [push] - handling errors of push_register core function Change-Id: Iaa78d5e00bdf744166441f9a9d1031d314a04cf9 Signed-off-by: Andrzej Popowski --- diff --git a/src/push/push_api.js b/src/push/push_api.js index caaff7a5..181b2ed1 100644 --- a/src/push/push_api.js +++ b/src/push/push_api.js @@ -57,7 +57,7 @@ PushManager.prototype.registerService = function(appControl, successCallback, er nullable: true } ]); - native.call('Push_registerService', { + var ret = native.call('Push_registerService', { operation: data.appControl.operation, uri: data.appControl.uri, mime: data.appControl.mime, @@ -72,6 +72,9 @@ PushManager.prototype.registerService = function(appControl, successCallback, er data.successCallback(msg.registrationId); } }); + if (native.isFailure(ret)) { + throw native.getErrorObject(ret); + } }; PushManager.prototype.unregisterService = function(successCallback, errorCallback) {