From: Alexander Alekhin Date: Sat, 27 Jan 2018 13:51:16 +0000 (+0000) Subject: core: add OpenCV version information into Exception messages X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~110^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f6fd3abd3113212ad12a0f67bd27634feeb23f55;p=platform%2Fupstream%2Fopencv.git core: add OpenCV version information into Exception messages --- diff --git a/modules/core/src/system.cpp b/modules/core/src/system.cpp index ccf2ca0..163951b 100644 --- a/modules/core/src/system.cpp +++ b/modules/core/src/system.cpp @@ -249,9 +249,9 @@ const char* Exception::what() const throw() { return msg.c_str(); } void Exception::formatMessage() { if( func.size() > 0 ) - msg = format("%s:%d: error: (%d) %s in function %s\n", file.c_str(), line, code, err.c_str(), func.c_str()); + msg = format("OpenCV(%s) %s:%d: error: (%d) %s in function %s\n", CV_VERSION, file.c_str(), line, code, err.c_str(), func.c_str()); else - msg = format("%s:%d: error: (%d) %s\n", file.c_str(), line, code, err.c_str()); + msg = format("OpenCV(%s) %s:%d: error: (%d) %s\n", CV_VERSION, file.c_str(), line, code, err.c_str()); } static const char* g_hwFeatureNames[CV_HARDWARE_MAX_FEATURE] = { NULL }; @@ -952,7 +952,8 @@ void error( const Exception& exc ) char buf[1 << 12]; cv_snprintf(buf, sizeof(buf), - "OpenCV Error: %s (%s) in %s, file %s, line %d", + "OpenCV(%s) Error: %s (%s) in %s, file %s, line %d", + CV_VERSION, errorStr, exc.err.c_str(), exc.func.size() > 0 ? exc.func.c_str() : "unknown function", exc.file.c_str(), exc.line); fprintf( stderr, "%s\n", buf );