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);
alarm->setDescription(converter.toString(arguments[2]));
}
} else {
- ThrowMsg(ConversionException, "Wrong first parameter type.");
+ //ThrowMsg(ConversionException, "Wrong first parameter type.");
}
return createJSCalendarAlarm(context, alarm);
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,