{
OC_LOG(INFO, TAG, "Build OCAction Instance.");
- if(action)
- {
- OICFree(action->resourceUri);
- OICFree(action);
- }
action = (OCAction*) OICMalloc(sizeof(OCAction));
VARIFY_POINTER_NULL(action, result, exit)
memset(action, 0, sizeof(OCAction));
std::string host = getHostFromURI(oit->getUri());
- tempResource = OCPlatform::constructResourceObject(host, uri, CT_ADAPTER_IP, true,
- oit->getResourceTypes(), m_if);
+ try
+ {
+ tempResource = OCPlatform::constructResourceObject(host, uri, CT_ADAPTER_IP, true,
+ oit->getResourceTypes(), m_if);
- p_resources.push_back(tempResource);
+ p_resources.push_back(tempResource);
+ } catch (std::exception& e)
+ {
+ std::cout << "Exception: " << e.what() << std::endl;
+ }
}
// Send GET messages to the child resources in turn.