Skip to content

Commit

Permalink
Merge pull request #134 from Fixstars-momoko/feature/add-exception-on…
Browse files Browse the repository at this point in the history
…-u3v-example

added exception on u3v_camera2_opencv
  • Loading branch information
iitaku authored Jan 7, 2023
2 parents 3a3bb80 + 1ba3a25 commit cd4556e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion example/u3v_camera2_opencv/u3v_camera2_opencv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include <ion/ion.h>

#include <exception>

using namespace ion;

#define FEATURE_GAIN_KEY "Gain"
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit cd4556e

Please sign in to comment.