Try -catch failure

#include <opencv2/highgui.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/objdetect.hpp>
#include <opencv2/barcode.hpp>
#include <opencv2/videoio.hpp>
Function : start
Accepts : Agv*
Returns : int
Abstraction : Take Agv* as argumnent and performs vision application
Modified by : 23-10-21 - Srikanth
int main() {

std::string videoStreamAddress = /";
cv::VideoCapture cap( videoStreamAddress );

catch(cv::Exception& e)
// const char* err_msg = e.what();
std::cout << "exception caught: " << e.msg << std::endl;
return 0;
this code not able catch exception.

I am pretty sure cap.isOpened() doesn’t throw exceptions. I am not even sure the cv::VideoCapture constructor does. When you run in debug what are the exception details printed to the cmd window/terminal?