#include <CommonsJavaScript/Validator.h>
#include <Tizen/Common/JSTizenExceptionFactory.h>
#include <Tizen/Common/JSTizenException.h>
-//#include <Tizen/Common/JSGlobalContextFactory.h>
#include "ContactConverter.h"
#include "JSContactRef.h"
{
LogDebug("entered");
-// AceSecurityStatus status = CONTACT_CHECK_ACCESS(controller->getContext(), CONTACT_FUNCTION_API_ADD);
+// AceSecurityStatus status = CONTACT_CHECK_ACCESS(CONTACT_FUNCTION_API_ADD);
// TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
JSContactRefPriv *priv = static_cast<JSContactRefPriv*>(JSObjectGetPrivate(constructor));
}
JSContextRef gContext = priv->getContext();
-// JSContextRef gContext = JSGlobalContextFactory::getInstance()->get();
-
BasicValidator validator = BasicValidatorFactory::getValidator(context, exception);
Try {
- if (argumentCount != 2)
- ThrowMsg(InvalidArgumentException, "Wrong arguments count.");
+ if (argumentCount < 2)
+ ThrowMsg(InvalidArgumentException, "2nd argument must be contact id");
if (!JSValueIsString(gContext, arguments[0]))
- ThrowMsg(InvalidArgumentException, "1st argument is not string.");
+ ThrowMsg(InvalidArgumentException, "1st argument must be address book id");
if (!JSValueIsString(gContext, arguments[1]))
- ThrowMsg(InvalidArgumentException, "2nd argument is not string.");
+ ThrowMsg(InvalidArgumentException, "2nd argument must be contact id");
} Catch(Exception ) {
LogError("Argument type mismatch : " << _rethrown_exception.GetMessage());
- *exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong arguments");
+ *exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::INVALID_VALUES_ERROR, "Wrong arguments");
return NULL;
}