From 5f39a1759a6ee5a274a8db486fd998a10bc4a1c2 Mon Sep 17 00:00:00 2001 From: Andrzej Popowski Date: Thu, 30 Apr 2015 11:42:08 +0200 Subject: [PATCH] [push] - handling errors of push_register core function Change-Id: Iaa78d5e00bdf744166441f9a9d1031d314a04cf9 Signed-off-by: Andrzej Popowski --- src/push/push_api.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) { -- 2.34.1