Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Error handling in C

I am developing in C using opencv 2.4.5 and need to gracefully handle run-time errors. The default behavior for opencv is to print an error and terminate the application. I'd like to not terminate the application.

In previous versions of the library, this could be changed using cvSetErrorMode, which has been deprecated.

Given that the current error handling is done by throwing a exception in C++, how are we to gracefully handle errors in C, which does not support exceptions?