Skip to content

Commit bbfa239

Browse files
committed
Merge pull request opencv#10706 from alalek:exception_opencv_version
2 parents c96630c + f6fd3ab commit bbfa239

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

modules/core/src/system.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,9 @@ const char* Exception::what() const throw() { return msg.c_str(); }
249249
void Exception::formatMessage()
250250
{
251251
if( func.size() > 0 )
252-
msg = format("%s:%d: error: (%d) %s in function %s\n", file.c_str(), line, code, err.c_str(), func.c_str());
252+
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());
253253
else
254-
msg = format("%s:%d: error: (%d) %s\n", file.c_str(), line, code, err.c_str());
254+
msg = format("OpenCV(%s) %s:%d: error: (%d) %s\n", CV_VERSION, file.c_str(), line, code, err.c_str());
255255
}
256256

257257
static const char* g_hwFeatureNames[CV_HARDWARE_MAX_FEATURE] = { NULL };
@@ -957,7 +957,8 @@ void error( const Exception& exc )
957957
char buf[1 << 12];
958958

959959
cv_snprintf(buf, sizeof(buf),
960-
"OpenCV Error: %s (%s) in %s, file %s, line %d",
960+
"OpenCV(%s) Error: %s (%s) in %s, file %s, line %d",
961+
CV_VERSION,
961962
errorStr, exc.err.c_str(), exc.func.size() > 0 ?
962963
exc.func.c_str() : "unknown function", exc.file.c_str(), exc.line);
963964
fprintf( stderr, "%s\n", buf );

0 commit comments

Comments
 (0)