title: Why "OpenCV's CV_Error" isn't catchable in Android owned C++ sources?
body: <p>I'm using OpenCV(4.2.0) in an android project. When calling some opencv methods from android project's C++ files, opencv throws <code>CV_Error</code> and the application terminates/crashes. Instead of the crash I want to handle the exception and resume the program. Is there anyway to catch those exceptions in the projects' C++ file? I have tried the following and it doesn't work.</p>
  <pre><code>try {
  ......
  
  } catch (...) {
  
  }
  </code></pre>
  <p><strong>Here is the stack trace from crashlytics</strong></p>
  <p><a href="https://i.stack.imgur.com/0Swxx.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0Swxx.jpg" alt="Here is the stack trace from crashlytics" /></a></p>
  <p>For some reason the <strong>CV_error</strong> <code>#define CV_Error( code, msg ) cv::error( code, msg, CV_Func, __FILE__, __LINE__ )</code> isn't catchable in android project owned C++ files. I have even tried the following just to check out. The catch block isn't executed.</p>
  <pre><code>try {
      CV_Error(Error::StsBadArg, &quot;Quadrangle is nonconvex or degenerated.&quot;);
  } catch (...) {
      // not catched
  }
  </code></pre>