[push] - handling errors of push_register core function
authorAndrzej Popowski <a.popowski@samsung.com>
Thu, 30 Apr 2015 09:42:08 +0000 (11:42 +0200)
committerPawel Andruszkiewicz <p.andruszkie@samsung.com>
Thu, 30 Apr 2015 10:39:00 +0000 (19:39 +0900)
Change-Id: Iaa78d5e00bdf744166441f9a9d1031d314a04cf9
Signed-off-by: Andrzej Popowski <a.popowski@samsung.com>
src/push/push_api.js

index caaff7a..181b2ed 100644 (file)
@@ -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) {