diff --git a/example/u3v_camera2_opencv/u3v_camera2_opencv.cc b/example/u3v_camera2_opencv/u3v_camera2_opencv.cc index 13ec6dab..8c9baba3 100644 --- a/example/u3v_camera2_opencv/u3v_camera2_opencv.cc +++ b/example/u3v_camera2_opencv/u3v_camera2_opencv.cc @@ -4,6 +4,8 @@ #include +#include + using namespace ion; #define FEATURE_GAIN_KEY "Gain" @@ -100,7 +102,14 @@ int main(int argc, char *argv[]) { pm.set(dispose_p, i == loop_num-1); // JIT compilation and execution of pipelines with Builder. - b.run(pm); + try { + b.run(pm); + }catch(std::exception& e){ + // e.what() shows the error message if pipeline build/run was failed. + std::cerr << "Failed to build pipeline" << std::endl; + std::cerr << e.what() << std::endl; + exit(1); + } // Convert the retrieved buffer object to OpenCV buffer format. // C and D are objects that store the result after smoothing.