SpeechPrivObject* privateObject = static_cast<SpeechPrivObject*>(JSObjectGetPrivate(thisObject));
- LoggerD("setCBListener break 1");
-
if (NULL == privateObject)
{
LoggerE("private object is null");
}
- LoggerD("setCBListener break 2");
-
- SpeechPtr speechPtr(privateObject->getObject()); //get the private object
-
- LoggerD("setCBListener break 3");
-
- JSContextRef gContext = privateObject->getContext(); // get the private context
-
- ArgumentValidator validator(context, argumentCount, arguments); //set up argument validator
- JSObjectRef callbackObj = validator.toCallbackObject(0,false,"onaudiostart","onsoundstart","onspeechstart", "onspeechend", "onsoundend", "onresult", "onnomatch", "onerror", "onstart", "onend", "NULL");
- JSValueProtect(context, callbackObj);
- speechPtr->setCBListener(callbackObj, gContext);
+ try{
+ SpeechPtr speechPtr(privateObject->getObject()); //get the private object
+ JSContextRef gContext = privateObject->getContext(); // get the private context
+ ArgumentValidator validator(context, argumentCount, arguments); //set up argument validator
+ JSObjectRef callbackObj = validator.toCallbackObject(0,false,"onaudiostart","onsoundstart","onspeechstart", "onspeechend", "onsoundend", "onresult", "onnomatch", "onerror", "onstart", "onend", NULL);
+ JSValueProtect(context, callbackObj);
+ speechPtr->setCBListener(callbackObj, gContext);
+ }
+ catch(...)
+ {
+ LoggerE("WRT Speech plugin failed on setCBListener");
+ }
return JSValueMakeUndefined(context);
}