Fix : The exception handling according to the situation
[platform/framework/native/content.git] / src / FCntContentTransfer.cpp
index 6853da8..98d3035 100644 (file)
@@ -1,5 +1,4 @@
 //
-// Open Service Platform
 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
 //
 // Licensed under the Apache License, Version 2.0 (the License);
@@ -195,8 +194,8 @@ ContentTransfer::Download(const Utility::Uri& uri, int fileSize, const String& d
 
        // Checks the privilege
        r = _AccessController::CheckUserPrivilege(_PRV_DOWNLOAD);
-       SysTryReturn(NID_CNT, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED,
-                       "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.");
+       r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED);
+       SysTryReturnResult(NID_CNT, r == E_SUCCESS, r, "The application is not permitted to call this method.");
 
        SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
 
@@ -215,8 +214,8 @@ ContentTransfer::Download(const Utility::Uri& uri, const String& filePath,
 
        // Checks the privilege
        r = _AccessController::CheckUserPrivilege(_PRV_DOWNLOAD);
-       SysTryReturn(NID_CNT, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED,
-                       "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.");
+       r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED);
+       SysTryReturnResult(NID_CNT, r == E_SUCCESS, r, "The application is not permitted to call this method.");
 
        SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
 
@@ -233,8 +232,8 @@ ContentTransfer::DownloadToBuffer(const Utility::Uri& uri, int fileSize, Request
        result r = E_SUCCESS;
 
        r = _AccessController::CheckUserPrivilege(_PRV_DOWNLOAD);
-       SysTryReturn(NID_CNT, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED,
-                       "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.");
+       r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED);
+       SysTryReturnResult(NID_CNT, r == E_SUCCESS, r, "The application is not permitted to call this method.");
 
        SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
 
@@ -251,8 +250,8 @@ ContentTransfer::DownloadToBuffer(const Utility::Uri& uri, RequestId& reqId, int
        result r = E_SUCCESS;
 
        r = _AccessController::CheckUserPrivilege(_PRV_DOWNLOAD);
-       SysTryReturn(NID_CNT, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED,
-                       "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.");
+       r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED);
+       SysTryReturnResult(NID_CNT, r == E_SUCCESS, r, "The application is not permitted to call this method.");
 
        SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");