Update change log and spec for wrt-plugins-tizen_0.4.29
[framework/web/wrt-plugins-tizen.git] / src / SecureElement / JSSEReader.cpp
index 397e3cc..1e3732f 100644 (file)
 #include <CommonsJavaScript/JSUtils.h>
 #include <CommonsJavaScript/JSCallbackManager.h>
 #include <CommonsJavaScript/Utils.h>
-#include <JSTizenExceptionFactory.h>
-#include <JSTizenException.h>
+#include <JSWebAPIErrorFactory.h>
 #include <SecurityExceptions.h>
 #include <ArgumentValidator.h>
-#include <JSWebAPIException.h>
 #include "SEFactory.h"
 #include "SEResponseDispatcher.h"
 #include "JSSEReader.h"
@@ -178,7 +176,7 @@ JSValueRef JSSEReader::getName(JSContextRef context,
        SEReaderPrivObject* privateObject = static_cast<SEReaderPrivObject*>(JSObjectGetPrivate(thisObject));
        if (NULL == privateObject) {
                LoggerE("private object is null");
-               return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
+               return JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::TYPE_MISMATCH_ERROR, "Type Mismatch");
        }
 
        ISEReaderPtr seReader(privateObject->getObject());
@@ -213,13 +211,13 @@ JSValueRef JSSEReader::openSession(JSContextRef context,
                }
        } catch (const BasePlatformException &err) {
         LoggerE(err.getName() << ": " << err.getMessage());
-        return JSWebAPIException::throwException(context, exception, err);
+        return JSWebAPIErrorFactory::postException(context, exception, err);
     }
 
        SEReaderPrivObject* privateObject = static_cast<SEReaderPrivObject*>(JSObjectGetPrivate(thisObject));
        if (NULL == privateObject) {
                LoggerE("private object is null");
-               return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
+               return JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::TYPE_MISMATCH_ERROR, "Type Mismatch");
        }
 
        ISEReaderPtr seReader(privateObject->getObject());
@@ -237,14 +235,14 @@ JSValueRef JSSEReader::openSession(JSContextRef context,
                return JSValueMakeUndefined(context);
        } Catch (ConversionException) {
                LoggerE("ConversionException");
-               return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
+               return JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::TYPE_MISMATCH_ERROR, "Type Mismatch");
        } Catch (WrtDeviceApis::Commons::UnknownException) {
                LoggerE("UnknownException: " << _rethrown_exception.GetMessage());
        } Catch (WrtDeviceApis::Commons::Exception) {
                LoggerE("Exception: " << _rethrown_exception.GetMessage());
        }
 
-       callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::UNKNOWN_ERROR,"Unknown Error"));
+       callbackManager->callOnError(JSWebAPIErrorFactory::makeErrorObject(context, JSWebAPIErrorFactory::UNKNOWN_ERROR,"Unknown Error"));
        return JSValueMakeUndefined(context);
 }
 
@@ -263,7 +261,7 @@ JSValueRef JSSEReader::closeSessions(JSContextRef context,
        SEReaderPrivObject* privateObject = static_cast<SEReaderPrivObject*>(JSObjectGetPrivate(thisObject));
        if (NULL == privateObject) {
                LoggerE("private object is null");
-               return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
+               return JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::TYPE_MISMATCH_ERROR, "Type Mismatch");
        }
 
        ISEReaderPtr seReader(privateObject->getObject());