From 2598863d026cc35f57702205ef3140041f8b93f5 Mon Sep 17 00:00:00 2001 From: Momoko Kono Date: Tue, 3 Jan 2023 15:58:30 -0800 Subject: [PATCH 1/2] added exception on u3v_camera2_opencv --- example/u3v_camera2_opencv/u3v_camera2_opencv.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/example/u3v_camera2_opencv/u3v_camera2_opencv.cc b/example/u3v_camera2_opencv/u3v_camera2_opencv.cc index 13ec6dab..48a5ab49 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,15 @@ 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 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. From 1ba3a25668713aacacc8385bc97f5d8727fc0769 Mon Sep 17 00:00:00 2001 From: Momoko Kono Date: Fri, 6 Jan 2023 13:12:05 -0800 Subject: [PATCH 2/2] updated error message --- example/u3v_camera2_opencv/u3v_camera2_opencv.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/example/u3v_camera2_opencv/u3v_camera2_opencv.cc b/example/u3v_camera2_opencv/u3v_camera2_opencv.cc index 48a5ab49..8c9baba3 100644 --- a/example/u3v_camera2_opencv/u3v_camera2_opencv.cc +++ b/example/u3v_camera2_opencv/u3v_camera2_opencv.cc @@ -105,13 +105,12 @@ int main(int argc, char *argv[]) try { b.run(pm); }catch(std::exception& e){ - // e.what() shows the error message if pipeline build was failed. + // 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. cv::Mat A(height, width, CV_16UC1);