| 547 | } |
| 548 | |
| 549 | void error( const Exception& exc ) |
| 550 | { |
| 551 | if (customErrorCallback != 0) |
| 552 | customErrorCallback(exc.code, exc.func.c_str(), exc.err.c_str(), |
| 553 | exc.file.c_str(), exc.line, customErrorCallbackData); |
| 554 | else |
| 555 | { |
| 556 | const char* errorStr = cvErrorStr(exc.code); |
| 557 | char buf[1 << 16]; |
| 558 | |
| 559 | sprintf( buf, "OpenCV Error: %s (%s) in %s, file %s, line %d", |
| 560 | errorStr, exc.err.c_str(), exc.func.size() > 0 ? |
| 561 | exc.func.c_str() : "unknown function", exc.file.c_str(), exc.line ); |
| 562 | fprintf( stderr, "%s\n", buf ); |
| 563 | fflush( stderr ); |
| 564 | # ifdef __ANDROID__ |
| 565 | __android_log_print(ANDROID_LOG_ERROR, "cv::error()", "%s", buf); |
| 566 | # endif |
| 567 | } |
| 568 | |
| 569 | if(breakOnError) |
| 570 | { |
| 571 | static volatile int* p = 0; |
| 572 | *p = 0; |
| 573 | } |
| 574 | |
| 575 | throw exc; |
| 576 | } |
| 577 | |
| 578 | CvErrorCallback |
| 579 | redirectError( CvErrorCallback errCallback, void* userdata, void** prevUserdata) |
no test coverage detected