Update change log and spec for wrt-plugins-tizen_0.4.59
[framework/web/wrt-plugins-tizen.git] / src / Calendar / JSCalendarAlarm.cpp
index 67d209d..00cb324 100755 (executable)
@@ -126,17 +126,18 @@ JSObjectRef DLL_EXPORT JSCalendarAlarm::constructor(JSContextRef context,
     const JSValueRef arguments[],
     JSValueRef* exception)
 {
+    EventAlarmPtr alarm( new EventAlarm() );
+
     Try
     {
-        if (argumentCount<1) {
-            ThrowMsg(ConversionException, "Wrong parameter type.");
+        if (argumentCount==0) {
+            //ThrowMsg(ConversionException, "Wrong parameter type.");
+               return createJSCalendarAlarm(context, alarm);
         }
 
         CalendarConverter converter(context);
         TimeUtilConverter timeConverter(context);
 
-        EventAlarmPtr alarm( new EventAlarm() );
-
         if (JSValueIsObjectOfClass(context, arguments[0], JSTZDate::getClassRef())){
             LoggerD("absoluteDate case");
             long long int absoluteDate = (long long int) (timeConverter.getTimeInMilliseconds(arguments[0])/1000);
@@ -160,7 +161,7 @@ JSObjectRef DLL_EXPORT JSCalendarAlarm::constructor(JSContextRef context,
                 alarm->setDescription(converter.toString(arguments[2]));
             }
         } else {
-            ThrowMsg(ConversionException, "Wrong first parameter type.");
+            //ThrowMsg(ConversionException, "Wrong first parameter type.");
         }
 
         return createJSCalendarAlarm(context, alarm);
@@ -168,23 +169,25 @@ JSObjectRef DLL_EXPORT JSCalendarAlarm::constructor(JSContextRef context,
     Catch(UnsupportedException)
     {
         LoggerW("Exception: "<<_rethrown_exception.GetMessage());
-        return JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
+        //return JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(InvalidArgumentException)
     {
         LoggerW("Exception: "<<_rethrown_exception.GetMessage());
-        return JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
+        //return JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(ConversionException)
     {
         LoggerW("Exception: "<<_rethrown_exception.GetMessage());
-        return JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
+        //return JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(Exception)
     {
         LoggerW("Exception: "<<_rethrown_exception.GetMessage());
-        return JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
+        //return JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
     }
+
+    return createJSCalendarAlarm(context, alarm);
 }
 
 void JSCalendarAlarm::initialize(JSContextRef context,