Catch exception system apply on server service 86/71886/5
authorKyungwook Tak <k.tak@samsung.com>
Fri, 27 May 2016 11:09:47 +0000 (20:09 +0900)
committerKyungwook Tak <k.tak@samsung.com>
Mon, 30 May 2016 02:29:09 +0000 (11:29 +0900)
Additionally, EXCEPTION_GUARD_CLOSER isn't needed anymore because all of
commands can handle results as optionally so only error code needed to
be serialized when exception catched.

Change-Id: I3bc2f58220b32f88e9fc66abb854b9f99274825d
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
12 files changed:
src/CMakeLists.txt
src/framework/service/access-control-cynara.cpp
src/framework/service/access-control-smack.cpp
src/framework/service/access-control.h
src/framework/service/cs-logic.cpp
src/framework/service/em-logic.cpp
src/framework/service/engine-error-converter.cpp
src/framework/service/exception.cpp [moved from src/framework/service/logic.cpp with 71% similarity]
src/framework/service/exception.h
src/framework/service/logic.h
src/framework/service/server-service.cpp
src/framework/service/wp-logic.cpp

index bebe40e..be82c63 100755 (executable)
@@ -40,7 +40,7 @@ PKG_CHECK_MODULES(${TARGET_CSR_SERVER}_DEP
 
 SET(${TARGET_CSR_SERVER}_SRCS
        framework/main/csr-main.cpp
-       framework/service/logic.cpp
+       framework/service/exception.cpp
        framework/service/cs-logic.cpp
        framework/service/wp-logic.cpp
        framework/service/em-logic.cpp
index eb6047a..1db76ba 100644 (file)
@@ -87,19 +87,21 @@ Cynara g_cynara;
 
 } // namespace anonymous
 
-bool hasPermission(const ConnShPtr &conn)
+void hasPermission(const ConnShPtr &conn)
 {
-       return hasPermission(conn, conn->getSockId());
+       hasPermission(conn, conn->getSockId());
 }
 
-bool hasPermission(const ConnShPtr &conn, SockId sockId)
+void hasPermission(const ConnShPtr &conn, SockId sockId)
 {
        const auto &c = conn->getCredential();
        const auto &d = getSockDesc(sockId);
 
        g_cynara.initialize();
 
-       return g_cynara.request(c.user, c.client, std::to_string(conn->getFd()), d.privilege);
+       if (!g_cynara.request(c.user, c.client, std::to_string(conn->getFd()), d.privilege))
+               ThrowExc(PermDenied, "Client[" << c.client << "] doesn't have permission"
+                                " to call API. Checked by cynara.");
 }
 
 }
index 1a5f5b8..cffeb70 100644 (file)
 
 namespace Csr {
 
-bool hasPermission(const ConnShPtr &conn)
+void hasPermission(const ConnShPtr &conn)
 {
-       return hasPermission(conn, conn->getSockId());
+       hasPermission(conn, conn->getSockId());
 }
 
-bool hasPermission(const ConnShPtr &conn, SockId sockId)
+void hasPermission(const ConnShPtr &conn, SockId sockId)
 {
        const auto &cred = conn->getCredential();
        const auto &sockDesc = getSockDesc(sockId);
@@ -41,7 +41,9 @@ bool hasPermission(const ConnShPtr &conn, SockId sockId)
        if (ret < 0)
                ThrowExc(InternalError, "smack_have_access failed.");
 
-       return ret == 1;
+       if (ret != 1)
+               ThrowExc(PermDenied, "Client[" << cred.label << "] doesn't have permission"
+                                " to call API. Checked by smack.");
 }
 
 }
index b7a2d41..31593c4 100644 (file)
 
 namespace Csr {
 
-bool hasPermission(const ConnShPtr &conn);
+void hasPermission(const ConnShPtr &conn);
 
 // for commands which has different privilege from
 // socket descriptor map information. Needed privilege and label should be used
 // associated with input sockId.
 // e.g., JUDGE_STATUS dispatched from SockId::CS but it's SockId::ADMIN privileged.
-bool hasPermission(const ConnShPtr &conn, SockId sockId);
+// Throw exception (PermDenied) if it's denied.
+void hasPermission(const ConnShPtr &conn, SockId sockId);
 
 }
index 5f3d089..100d5e4 100644 (file)
@@ -30,6 +30,7 @@
 #include "service/type-converter.h"
 #include "service/engine-error-converter.h"
 #include "service/core-usage.h"
+#include "service/exception.h"
 #include "ui/askuser.h"
 #include <csr-error.h>
 
@@ -83,10 +84,6 @@ RawBuffer CsLogic::scanData(const CsContext &context, const RawBuffer &data)
 
        return this->handleAskUser(context, d);
 
-       EXCEPTION_GUARD_CLOSER(ret)
-
-       return BinaryQueue::Serialize(ret).pop();
-
        EXCEPTION_GUARD_END
 }
 
@@ -362,10 +359,6 @@ RawBuffer CsLogic::scanFile(const CsContext &context, const std::string &filepat
 
        return this->handleAskUser(context, *history);
 
-       EXCEPTION_GUARD_CLOSER(ret)
-
-       return BinaryQueue::Serialize(ret).pop();
-
        EXCEPTION_GUARD_END
 }
 
@@ -439,10 +432,6 @@ RawBuffer CsLogic::getScannableFiles(const std::string &dir)
 
        return BinaryQueue::Serialize(CSR_ERROR_NONE, fileset).pop();
 
-       EXCEPTION_GUARD_CLOSER(ret)
-
-       return BinaryQueue::Serialize(ret).pop();
-
        EXCEPTION_GUARD_END
 }
 
@@ -454,10 +443,6 @@ RawBuffer CsLogic::setDirTimestamp(const std::string &dir, time_t ts)
 
        return BinaryQueue::Serialize(CSR_ERROR_NONE).pop();
 
-       EXCEPTION_GUARD_CLOSER(ret)
-
-       return BinaryQueue::Serialize(ret).pop();
-
        EXCEPTION_GUARD_END
 }
 
@@ -515,10 +500,6 @@ RawBuffer CsLogic::judgeStatus(const std::string &filepath, csr_cs_action_e acti
 
        return BinaryQueue::Serialize(CSR_ERROR_NONE).pop();
 
-       EXCEPTION_GUARD_CLOSER(ret)
-
-       return BinaryQueue::Serialize(ret).pop();
-
        EXCEPTION_GUARD_END
 }
 
@@ -533,10 +514,6 @@ RawBuffer CsLogic::getDetected(const std::string &filepath)
        else
                return BinaryQueue::Serialize(CSR_ERROR_NONE).pop();
 
-       EXCEPTION_GUARD_CLOSER(ret)
-
-       return BinaryQueue::Serialize(ret).pop();
-
        EXCEPTION_GUARD_END
 }
 
@@ -557,10 +534,6 @@ RawBuffer CsLogic::getDetectedList(const StrSet &dirSet)
        else
                return BinaryQueue::Serialize(CSR_ERROR_NONE, rows).pop();
 
-       EXCEPTION_GUARD_CLOSER(ret)
-
-       return BinaryQueue::Serialize(ret).pop();
-
        EXCEPTION_GUARD_END
 }
 
@@ -576,10 +549,6 @@ RawBuffer CsLogic::getIgnored(const std::string &filepath)
        else
                return BinaryQueue::Serialize(CSR_ERROR_NONE).pop();
 
-       EXCEPTION_GUARD_CLOSER(ret)
-
-       return BinaryQueue::Serialize(ret).pop();
-
        EXCEPTION_GUARD_END
 }
 
@@ -600,10 +569,6 @@ RawBuffer CsLogic::getIgnoredList(const StrSet &dirSet)
        else
                return BinaryQueue::Serialize(CSR_ERROR_NONE, rows).pop();
 
-       EXCEPTION_GUARD_CLOSER(ret)
-
-       return BinaryQueue::Serialize(ret).pop();
-
        EXCEPTION_GUARD_END
 }
 
index 5e7b4b2..a1370d8 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "common/audit/logger.h"
 #include "service/engine-error-converter.h"
+#include "service/exception.h"
 #include <csr-error.h>
 
 namespace Csr {
@@ -89,10 +90,6 @@ RawBuffer EmLogic::getEngineName(const EmContext &context)
                return BinaryQueue::Serialize(CSR_ERROR_NONE, value).pop();
        }
 
-       EXCEPTION_GUARD_CLOSER(ret)
-
-       return BinaryQueue::Serialize(ret).pop();
-
        EXCEPTION_GUARD_END
 }
 
@@ -121,10 +118,6 @@ RawBuffer EmLogic::getEngineVendor(const EmContext &context)
                return BinaryQueue::Serialize(CSR_ERROR_NONE, value).pop();
        }
 
-       EXCEPTION_GUARD_CLOSER(ret)
-
-       return BinaryQueue::Serialize(ret).pop();
-
        EXCEPTION_GUARD_END
 }
 
@@ -153,10 +146,6 @@ RawBuffer EmLogic::getEngineVersion(const EmContext &context)
                return BinaryQueue::Serialize(CSR_ERROR_NONE, value).pop();
        }
 
-       EXCEPTION_GUARD_CLOSER(ret)
-
-       return BinaryQueue::Serialize(ret).pop();
-
        EXCEPTION_GUARD_END
 }
 
@@ -185,10 +174,6 @@ RawBuffer EmLogic::getEngineDataVersion(const EmContext &context)
                return BinaryQueue::Serialize(CSR_ERROR_NONE, value).pop();
        }
 
-       EXCEPTION_GUARD_CLOSER(ret)
-
-       return BinaryQueue::Serialize(ret).pop();
-
        EXCEPTION_GUARD_END
 }
 
@@ -221,10 +206,6 @@ RawBuffer EmLogic::getEngineUpdatedTime(const EmContext &context)
                return BinaryQueue::Serialize(CSR_ERROR_NONE, ts64).pop();
        }
 
-       EXCEPTION_GUARD_CLOSER(ret)
-
-       return BinaryQueue::Serialize(ret, -1).pop();
-
        EXCEPTION_GUARD_END
 }
 
@@ -269,10 +250,6 @@ RawBuffer EmLogic::getEngineActivated(const EmContext &context)
 
        return BinaryQueue::Serialize(CSR_ERROR_NONE, static_cast<int>(activated)).pop();
 
-       EXCEPTION_GUARD_CLOSER(ret)
-
-       return BinaryQueue::Serialize(ret, -1).pop();
-
        EXCEPTION_GUARD_END
 }
 
@@ -289,10 +266,6 @@ RawBuffer EmLogic::getEngineState(const EmContext &context)
                        static_cast<int>(state) == -1 ? static_cast<int>(CSR_DISABLE) :
                                                                                        static_cast<int>(state)).pop();
 
-       EXCEPTION_GUARD_CLOSER(ret)
-
-       return BinaryQueue::Serialize(ret, -1).pop();
-
        EXCEPTION_GUARD_END
 }
 
@@ -307,10 +280,6 @@ RawBuffer EmLogic::setEngineState(const EmContext &context, csr_state_e state)
 
        return BinaryQueue::Serialize(CSR_ERROR_NONE).pop();
 
-       EXCEPTION_GUARD_CLOSER(ret)
-
-       return BinaryQueue::Serialize(ret).pop();
-
        EXCEPTION_GUARD_END
 }
 
index f9d14b2..f3caae5 100644 (file)
@@ -35,7 +35,7 @@ void toException(int ee)
                throw std::bad_alloc();
 
        case CSRE_ERROR_PERMISSION_DENIED:
-               ThrowExc(PermDenied, "access denied related to engine");
+               ThrowExc(EnginePermDenied, "access denied related to engine");
 
        case CSRE_ERROR_FILE_NOT_FOUND:
                ThrowExc(FileDoNotExist, "file not found.");
similarity index 71%
rename from src/framework/service/logic.cpp
rename to src/framework/service/exception.cpp
index dafe72b..39979be 100644 (file)
  *  limitations under the License
  */
 /*
- * @file        logic.cpp
+ * @file        exception.cpp
  * @author      Kyungwook Tak (k.tak@samsung.com)
  * @version     1.0
- * @brief
+ * @brief       exception guard and custom exceptions which are thrown
+ *              only on server side
  */
-#include "service/logic.h"
+#include "service/exception.h"
 
 #include <exception>
 
 #include "common/audit/logger.h"
-#include "service/exception.h"
+#include "common/binary-queue.h"
 #include <csr-error.h>
 
 namespace Csr {
 
-RawBuffer Logic::exceptionGuard(const std::function<RawBuffer()> &func,
-                                                               const std::function<RawBuffer(int)> &closer)
+RawBuffer exceptionGuard(const std::function<RawBuffer()> &func)
 {
        try {
                return func();
        } catch (const Exception &e) {
                ERROR("Exception caught. code: " << e.error() << " message: " << e.what());
-               return closer(e.error());
+               return BinaryQueue::Serialize(e.error()).pop();
        } catch (const std::invalid_argument &e) {
                ERROR("Invalid argument: " << e.what());
-               return closer(CSR_ERROR_INVALID_PARAMETER);
+               return BinaryQueue::Serialize(CSR_ERROR_INVALID_PARAMETER).pop();
        } catch (const std::bad_alloc &e) {
                ERROR("memory alloc failed: " << e.what());
-               return closer(CSR_ERROR_OUT_OF_MEMORY);
+               return BinaryQueue::Serialize(CSR_ERROR_OUT_OF_MEMORY).pop();
        } catch (const std::exception &e) {
                ERROR("std exception: " << e.what());
-               return closer(CSR_ERROR_UNKNOWN);
+               return BinaryQueue::Serialize(CSR_ERROR_UNKNOWN).pop();
        } catch (...) {
                ERROR("Unknown exception occured in logic");
-               return closer(CSR_ERROR_UNKNOWN);
+               return BinaryQueue::Serialize(CSR_ERROR_UNKNOWN).pop();
        }
 }
 
index cce19ab..f2965f8 100644 (file)
  * @file        exception.h
  * @author      Kyungwook Tak (k.tak@samsung.com)
  * @version     1.0
- * @brief       custom exceptions which are thrown only on server side
+ * @brief       exception guard and custom exceptions which are thrown
+ *              only on server side
  */
 #pragma once
 
+#include <functional>
+
 #include "common/exception.h"
+#include "common/types.h"
+
+#define EXCEPTION_GUARD_START return Csr::exceptionGuard([&]() {
+#define EXCEPTION_GUARD_END   });
 
 namespace Csr {
 
 // exceptions listed here are only thrown in server side.
-using PermDenied         = DerivedException<CSR_ERROR_ENGINE_PERMISSION>;
+using PermDenied         = DerivedException<CSR_ERROR_PERMISSION_DENIED>;
 using DbFailed           = DerivedException<CSR_ERROR_DB>;
 using RemoveFailed       = DerivedException<CSR_ERROR_REMOVE_FAILED>;
 using FileChanged        = DerivedException<CSR_ERROR_FILE_CHANGED>;
 using EngineError        = DerivedException<CSR_ERROR_ENGINE_INTERNAL>;
 using EngineNotActivated = DerivedException<CSR_ERROR_ENGINE_NOT_ACTIVATED>;
 using EngineDisabled     = DerivedException<CSR_ERROR_ENGINE_DISABLED>;
+using EnginePermDenied   = DerivedException<CSR_ERROR_ENGINE_PERMISSION>;
+
+RawBuffer exceptionGuard(const std::function<RawBuffer()> &);
 
 }
index b30b808..97d81bf 100644 (file)
  */
 #pragma once
 
-#include <functional>
-
-#include "common/types.h"
-
-#define EXCEPTION_GUARD_START          return Csr::Logic::exceptionGuard([&]() {
-#define EXCEPTION_GUARD_CLOSER(retArg) }, [](int retArg) {
-#define EXCEPTION_GUARD_END            });
-
 namespace Csr {
 
 class Logic {
 public:
-       static RawBuffer exceptionGuard(const std::function<RawBuffer()> &func,
-                                                                       const std::function<RawBuffer(int)> &closer);
+       virtual ~Logic() = default;
 };
 
 }
index 8fc6b69..9c66b0a 100644 (file)
@@ -98,6 +98,8 @@ ServerService::ServerService() :
 
 RawBuffer ServerService::processCs(const ConnShPtr &conn, RawBuffer &data)
 {
+       EXCEPTION_GUARD_START
+
        BinaryQueue q;
        q.push(data);
 
@@ -107,8 +109,7 @@ RawBuffer ServerService::processCs(const ConnShPtr &conn, RawBuffer &data)
 
        switch (cid) {
        case CommandId::SCAN_DATA: {
-               if (!hasPermission(conn))
-                       return BinaryQueue::Serialize(CSR_ERROR_PERMISSION_DENIED).pop();
+               hasPermission(conn);
 
                CsContextShPtr cptr;
                RawBuffer data;
@@ -118,8 +119,7 @@ RawBuffer ServerService::processCs(const ConnShPtr &conn, RawBuffer &data)
        }
 
        case CommandId::SCAN_FILE: {
-               if (!hasPermission(conn))
-                       return BinaryQueue::Serialize(CSR_ERROR_PERMISSION_DENIED).pop();
+               hasPermission(conn);
 
                CsContextShPtr cptr;
                std::string filepath;
@@ -129,8 +129,7 @@ RawBuffer ServerService::processCs(const ConnShPtr &conn, RawBuffer &data)
        }
 
        case CommandId::GET_SCANNABLE_FILES: {
-               if (!hasPermission(conn))
-                       return BinaryQueue::Serialize(CSR_ERROR_PERMISSION_DENIED).pop();
+               hasPermission(conn);
 
                std::string dir;
                q.Deserialize(dir);
@@ -139,6 +138,8 @@ RawBuffer ServerService::processCs(const ConnShPtr &conn, RawBuffer &data)
        }
 
        case CommandId::SET_DIR_TIMESTAMP: {
+               hasPermission(conn);
+
                std::string dir;
                int64_t ts64 = 0;
                q.Deserialize(dir, ts64);
@@ -148,8 +149,7 @@ RawBuffer ServerService::processCs(const ConnShPtr &conn, RawBuffer &data)
 
        case CommandId::JUDGE_STATUS: {
                // judge status needs admin privilege
-               if (!hasPermission(conn, SockId::ADMIN))
-                       return BinaryQueue::Serialize(CSR_ERROR_PERMISSION_DENIED).pop();
+               hasPermission(conn, SockId::ADMIN);
 
                std::string filepath;
                int intAction;
@@ -159,8 +159,7 @@ RawBuffer ServerService::processCs(const ConnShPtr &conn, RawBuffer &data)
        }
 
        case CommandId::GET_DETECTED: {
-               if (!hasPermission(conn))
-                       return BinaryQueue::Serialize(CSR_ERROR_PERMISSION_DENIED).pop();
+               hasPermission(conn);
 
                std::string filepath;
                q.Deserialize(filepath);
@@ -169,8 +168,7 @@ RawBuffer ServerService::processCs(const ConnShPtr &conn, RawBuffer &data)
        }
 
        case CommandId::GET_DETECTED_LIST: {
-               if (!hasPermission(conn))
-                       return BinaryQueue::Serialize(CSR_ERROR_PERMISSION_DENIED).pop();
+               hasPermission(conn);
 
                StrSet dirSet;
                q.Deserialize(dirSet);
@@ -179,8 +177,7 @@ RawBuffer ServerService::processCs(const ConnShPtr &conn, RawBuffer &data)
        }
 
        case CommandId::GET_IGNORED: {
-               if (!hasPermission(conn))
-                       return BinaryQueue::Serialize(CSR_ERROR_PERMISSION_DENIED).pop();
+               hasPermission(conn);
 
                std::string filepath;
                q.Deserialize(filepath);
@@ -189,8 +186,7 @@ RawBuffer ServerService::processCs(const ConnShPtr &conn, RawBuffer &data)
        }
 
        case CommandId::GET_IGNORED_LIST: {
-               if (!hasPermission(conn))
-                       return BinaryQueue::Serialize(CSR_ERROR_PERMISSION_DENIED).pop();
+               hasPermission(conn);
 
                StrSet dirSet;
                q.Deserialize(dirSet);
@@ -201,12 +197,15 @@ RawBuffer ServerService::processCs(const ConnShPtr &conn, RawBuffer &data)
        default:
                ThrowExc(InternalError, "CS Command isn't in range");
        }
+
+       EXCEPTION_GUARD_END
 }
 
 RawBuffer ServerService::processWp(const ConnShPtr &conn, RawBuffer &data)
 {
-       if (!hasPermission(conn))
-               return BinaryQueue::Serialize(CSR_ERROR_PERMISSION_DENIED).pop();
+       EXCEPTION_GUARD_START
+
+       hasPermission(conn);
 
        BinaryQueue q;
        q.push(data);
@@ -227,24 +226,25 @@ RawBuffer ServerService::processWp(const ConnShPtr &conn, RawBuffer &data)
        default:
                ThrowExc(InternalError, "WP Command isn't in range");
        }
+
+       EXCEPTION_GUARD_END
 }
 
 RawBuffer ServerService::processAdmin(const ConnShPtr &conn, RawBuffer &data)
 {
+       EXCEPTION_GUARD_START
+
+       hasPermission(conn);
+
        BinaryQueue q;
        q.push(data);
 
-       bool hasPerm = hasPermission(conn);
-
        auto cid = extractCommandId(q);
 
        INFO("Admin request process. command id: " << cidToString(cid));
 
        switch (cid) {
        case CommandId::EM_GET_NAME: {
-               if (!hasPerm)
-                       return BinaryQueue::Serialize(CSR_ERROR_PERMISSION_DENIED).pop();
-
                EmContextShPtr cptr;
                q.Deserialize(cptr);
 
@@ -252,9 +252,6 @@ RawBuffer ServerService::processAdmin(const ConnShPtr &conn, RawBuffer &data)
        }
 
        case CommandId::EM_GET_VENDOR: {
-               if (!hasPerm)
-                       return BinaryQueue::Serialize(CSR_ERROR_PERMISSION_DENIED).pop();
-
                EmContextShPtr cptr;
                q.Deserialize(cptr);
 
@@ -262,9 +259,6 @@ RawBuffer ServerService::processAdmin(const ConnShPtr &conn, RawBuffer &data)
        }
 
        case CommandId::EM_GET_VERSION: {
-               if (!hasPerm)
-                       return BinaryQueue::Serialize(CSR_ERROR_PERMISSION_DENIED).pop();
-
                EmContextShPtr cptr;
                q.Deserialize(cptr);
 
@@ -272,9 +266,6 @@ RawBuffer ServerService::processAdmin(const ConnShPtr &conn, RawBuffer &data)
        }
 
        case CommandId::EM_GET_DATA_VERSION: {
-               if (!hasPerm)
-                       return BinaryQueue::Serialize(CSR_ERROR_PERMISSION_DENIED).pop();
-
                EmContextShPtr cptr;
                q.Deserialize(cptr);
 
@@ -282,9 +273,6 @@ RawBuffer ServerService::processAdmin(const ConnShPtr &conn, RawBuffer &data)
        }
 
        case CommandId::EM_GET_UPDATED_TIME: {
-               if (!hasPerm)
-                       return BinaryQueue::Serialize(CSR_ERROR_PERMISSION_DENIED).pop();
-
                EmContextShPtr cptr;
                q.Deserialize(cptr);
 
@@ -292,9 +280,6 @@ RawBuffer ServerService::processAdmin(const ConnShPtr &conn, RawBuffer &data)
        }
 
        case CommandId::EM_GET_ACTIVATED: {
-               if (!hasPerm)
-                       return BinaryQueue::Serialize(CSR_ERROR_PERMISSION_DENIED).pop();
-
                EmContextShPtr cptr;
                q.Deserialize(cptr);
 
@@ -302,9 +287,6 @@ RawBuffer ServerService::processAdmin(const ConnShPtr &conn, RawBuffer &data)
        }
 
        case CommandId::EM_GET_STATE: {
-               if (!hasPerm)
-                       return BinaryQueue::Serialize(CSR_ERROR_PERMISSION_DENIED).pop();
-
                EmContextShPtr cptr;
                q.Deserialize(cptr);
 
@@ -312,9 +294,6 @@ RawBuffer ServerService::processAdmin(const ConnShPtr &conn, RawBuffer &data)
        }
 
        case CommandId::EM_SET_STATE: {
-               if (!hasPerm)
-                       return BinaryQueue::Serialize(CSR_ERROR_PERMISSION_DENIED).pop();
-
                EmContextShPtr cptr;
                int intState;
                q.Deserialize(cptr, intState);
@@ -325,6 +304,8 @@ RawBuffer ServerService::processAdmin(const ConnShPtr &conn, RawBuffer &data)
        default:
                ThrowExc(InternalError, "ADMIN Command isn't in range");
        }
+
+       EXCEPTION_GUARD_END
 }
 
 void ServerService::onMessageProcess(const ConnShPtr &connection)
index b4b78d7..a25f095 100644 (file)
@@ -26,6 +26,7 @@
 #include "common/audit/logger.h"
 #include "service/type-converter.h"
 #include "service/engine-error-converter.h"
+#include "service/exception.h"
 #include "ui/askuser.h"
 #include <csr-error.h>
 
@@ -80,10 +81,6 @@ RawBuffer WpLogic::checkUrl(const WpContext &context, const std::string &url)
 
        return BinaryQueue::Serialize(CSR_ERROR_NONE, wr).pop();
 
-       EXCEPTION_GUARD_CLOSER(ret)
-
-       return BinaryQueue::Serialize(ret).pop();
-
        EXCEPTION_GUARD_END
 }