return MEDIA_VISION_ERROR_INVALID_PARAMETER;
}
- Context *context = static_cast<Context *>(handle);
- auto task = static_cast<FaceRecognitionTask *>(context->__tasks["face_recognition"]);
+ try {
+ Context *context = static_cast<Context *>(handle);
+ auto task = static_cast<FaceRecognitionTask *>(context->__tasks["face_recognition"]);
- task->configure();
- task->prepare();
+ task->configure();
+ task->prepare();
+ } catch (const BaseException& e) {
+ LOGE("%s", e.what());
+ return e.getError();
+ }
LOGD("LEAVE");
task->setInput(input);
task->perform();
} catch (const BaseException& e) {
- LOGE("Fail to register new face.");
+ LOGE("%s", e.what());
return e.getError();
}
task->setInput(input);
task->perform();
} catch (const BaseException& e) {
- LOGE("Fail to unregister a given label.");
+ LOGE("%s", e.what());
return e.getError();
}
task->setInput(input);
task->perform();
} catch (const BaseException& e) {
- LOGE("Fail to recognize a face.");
+ LOGE("%s", e.what());
return e.getError();
}
*out_label = task->getOutput().label.c_str();
} catch (const BaseException& e) {
- LOGE("Fail to get label.");
+ LOGE("%s", e.what());
return e.getError();
}