Fix error handling
authorJaekyun Lee <jkyun.lee@samsung.com>
Fri, 19 Apr 2013 12:47:40 +0000 (21:47 +0900)
committerJaekyun Lee <jkyun.lee@samsung.com>
Fri, 19 Apr 2013 12:47:40 +0000 (21:47 +0900)
Change-Id: I0547cd6d943e059e45c42b6ba546d12d4ee4447b

client/ClientChannel.cpp
client/Reader.cpp
client/Session.cpp
client/include/ClientChannel.h
client/include/Reader.h
client/include/Session.h
common/include/Channel.h
common/include/Exception.h
common/include/ReaderHelper.h
common/include/SessionHelper.h

index afbf2a4..fbff48c 100644 (file)
@@ -61,7 +61,9 @@ namespace smartcard_service_api
                closeSync();
        }
 
-       void ClientChannel::closeSync() throw(ErrorIO &, ErrorIllegalState &)
+       void ClientChannel::closeSync()
+               throw(ExceptionBase &, ErrorIO &, ErrorSecurity &,
+                       ErrorIllegalState &, ErrorIllegalParameter &)
        {
 #ifdef CLIENT_IPC_THREAD
                if (isClosed() == false)
@@ -146,7 +148,8 @@ namespace smartcard_service_api
        }
 
        int ClientChannel::transmitSync(ByteArray command, ByteArray &result)
-               throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &)
+               throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &,
+                       ErrorIllegalParameter &, ErrorSecurity &)
        {
                int rv = SCARD_ERROR_OK;
 
index ffde6fc..8acb9a7 100644 (file)
@@ -89,7 +89,8 @@ namespace smartcard_service_api
        }
 
        SessionHelper *Reader::openSessionSync()
-               throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &)
+               throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &,
+                       ErrorIllegalParameter &, ErrorSecurity &)
        {
                openedSession = NULL;
 
index 403e30f..95f85af 100644 (file)
@@ -76,7 +76,9 @@ namespace smartcard_service_api
                }
        }
 
-       ByteArray Session::getATRSync() throw (ErrorIO &, ErrorIllegalState &)
+       ByteArray Session::getATRSync()
+               throw (ExceptionBase &, ErrorIO &, ErrorSecurity &,
+                       ErrorIllegalState &, ErrorIllegalParameter &)
        {
                ByteArray result;
                if (getReader()->isSecureElementPresent() == true)
@@ -174,7 +176,9 @@ namespace smartcard_service_api
                return result;
        }
 
-       void Session::closeSync() throw (ErrorIO &, ErrorIllegalState &)
+       void Session::closeSync()
+               throw (ExceptionBase &, ErrorIO &, ErrorSecurity &,
+                       ErrorIllegalState &, ErrorIllegalParameter &)
        {
                Message msg;
                int rv;
@@ -332,7 +336,8 @@ namespace smartcard_service_api
        }
 
        Channel *Session::openChannelSync(int id, ByteArray aid)
-               throw (ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &)
+               throw (ExceptionBase &, ErrorIO &, ErrorIllegalState &,
+                       ErrorIllegalParameter &, ErrorSecurity &)
        {
                openedChannel = NULL;
 
index bbd5194..9a8ae6f 100644 (file)
@@ -52,9 +52,10 @@ namespace smartcard_service_api
                        void *userParam);
 
                void closeSync()
-                       throw(ErrorIO &, ErrorIllegalState &);
+                       throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &,
+                               ErrorSecurity &, ErrorIllegalParameter &);
                int transmitSync(ByteArray command, ByteArray &result)
-                       throw(ErrorIO &, ErrorIllegalState &,
+                       throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &,
                                ErrorIllegalParameter &, ErrorSecurity &);
 
                friend class ClientDispatcher;
index d80d1ed..d06e22a 100644 (file)
@@ -53,7 +53,7 @@ namespace smartcard_service_api
 
                int openSession(openSessionCallback callback, void *userData);
                SessionHelper *openSessionSync()
-                       throw(ErrorIO &, ErrorIllegalState &,
+                       throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &,
                                ErrorIllegalParameter &, ErrorSecurity &);
 
                friend class SEService;
index ad91ce8..2329e59 100644 (file)
@@ -49,7 +49,8 @@ namespace smartcard_service_api
                static bool dispatcherCallback(void *message);
 
                Channel *openChannelSync(int id, ByteArray aid)
-                       throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &);
+                       throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &,
+                               ErrorIllegalParameter &, ErrorSecurity &);
 
        public:
                void closeChannels()
@@ -65,22 +66,28 @@ namespace smartcard_service_api
                int getChannelCount(getChannelCountCallback callback, void * userData);
 
                ByteArray getATRSync()
-                       throw(ErrorIO &, ErrorIllegalState &);
+                       throw(ExceptionBase &, ErrorIO &, ErrorSecurity &,
+                               ErrorIllegalState &, ErrorIllegalParameter &);
 
                void closeSync()
-                       throw(ErrorIO &, ErrorIllegalState &);
+                       throw(ExceptionBase &, ErrorIO &, ErrorSecurity &,
+                               ErrorIllegalState &, ErrorIllegalParameter &);
 
                Channel *openBasicChannelSync(ByteArray aid)
-                       throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &);
+                       throw(ErrorIO &, ErrorIllegalState &,
+                               ErrorIllegalParameter &, ErrorSecurity &);
 
                Channel *openBasicChannelSync(unsigned char *aid, unsigned int length)
-                       throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &);
+                       throw(ErrorIO &, ErrorIllegalState &,
+                               ErrorIllegalParameter &, ErrorSecurity &);
 
                Channel *openLogicalChannelSync(ByteArray aid)
-                       throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &);
+                       throw(ErrorIO &, ErrorIllegalState &,
+                               ErrorIllegalParameter &, ErrorSecurity &);
 
                Channel *openLogicalChannelSync(unsigned char *aid, unsigned int length)
-                       throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &);
+                       throw(ErrorIO &, ErrorIllegalState &,
+                               ErrorIllegalParameter &, ErrorSecurity &);
 
                unsigned int getChannelCountSync();
 
index a6a5dc9..2e0579f 100644 (file)
@@ -59,10 +59,12 @@ namespace smartcard_service_api
                virtual int transmit(ByteArray command, transmitCallback callback, void *userData) = 0;
 
                virtual void closeSync()
-                       throw(ErrorIO &, ErrorIllegalState &) = 0;
+                       throw(ExceptionBase &, ErrorIO &, ErrorSecurity &,
+                       ErrorIllegalState &, ErrorIllegalParameter &) = 0;
 
                virtual int transmitSync(ByteArray command, ByteArray &result)
-                       throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &) = 0;
+                       throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &,
+                               ErrorIllegalParameter &, ErrorSecurity &) = 0;
        };
 
 } /* namespace smartcard_service_api */
index 4d7ba46..655b50b 100644 (file)
@@ -178,8 +178,8 @@ namespace smartcard_service_api
        {
        public :
                static void throwError(int errorCode)
-                       throw(ErrorIO &, ErrorSecurity &, ErrorIllegalState &,
-                               ErrorIllegalParameter &)
+                       throw(ExceptionBase &, ErrorIO &, ErrorSecurity &,
+                               ErrorIllegalState &, ErrorIllegalParameter &)
                {
                        switch (errorCode)
                        {
index 9a42d2b..807cc64 100644 (file)
@@ -55,7 +55,8 @@ namespace smartcard_service_api
 
                virtual int openSession(openSessionCallback callback, void *userData) = 0;
                virtual SessionHelper *openSessionSync()
-                       throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &)= 0;
+                       throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &,
+                               ErrorIllegalParameter &, ErrorSecurity &)= 0;
        };
 
 } /* namespace smartcard_service_api */
index 8599612..1798563 100644 (file)
@@ -65,10 +65,12 @@ namespace smartcard_service_api
                virtual int openLogicalChannel(unsigned char *aid, unsigned int length, openChannelCallback callback, void *userData) = 0;
 
                virtual ByteArray getATRSync()
-                       throw(ErrorIO &, ErrorIllegalState &) = 0;
+                       throw(ExceptionBase &, ErrorIO &, ErrorSecurity &,
+                       ErrorIllegalState &, ErrorIllegalParameter &) = 0;
 
                virtual void closeSync()
-                       throw(ErrorIO &, ErrorIllegalState &) = 0;
+                       throw(ExceptionBase &, ErrorIO &, ErrorSecurity &,
+                       ErrorIllegalState &, ErrorIllegalParameter &) = 0;
 
                virtual Channel *openBasicChannelSync(ByteArray aid)
                        throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &) = 0;