0

I am working on a legacy android codebase which uses OpenCV4Android using the NDK. A particular class of problems I have are of this form :

  1. The ndk c++ method calls an OpenCV function.
  2. The opencv function has a CV_Assert (a subclass of std::exception) which fails and throws an exception.
  3. The c++ method doesn't catch the exception - but the calling method of the c++ method which called the opencv function handles the exception by logging a message.

The problem is that I don't get information about the method which calls the opencv function. Putting this method in a try catch block is an option but there are a lot of calls like this and I am looking for an alternative.

Void foo() {
libfun() // this throws exception
..
libfun()
..
libfun()}

Void bar() {
Try{
 Foo()
 }
 Catch(Exception e)
 { Log}
3
  • please post code Commented Jun 29, 2017 at 16:57
  • also using a debugger might be helpful, are you running code in an IDE? Commented Jun 29, 2017 at 16:58
  • @pyjg I already do that, but my concerns are more to do with shipped code. Having a better way of dealing with it instead of trying to hunt for the line each time. Commented Jun 29, 2017 at 17:10

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.