Skip to content

Commit dc1d9ae

Browse files
native-apivpisarev
authored andcommitted
Include error code description into the message (opencv#10982)
1 parent c219f97 commit dc1d9ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/core/src/system.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,9 @@ const char* Exception::what() const throw() { return msg.c_str(); }
248248
void Exception::formatMessage()
249249
{
250250
if( func.size() > 0 )
251-
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());
251+
msg = format("OpenCV(%s) %s:%d: error: (%d) %s: %s in function %s\n", CV_VERSION, file.c_str(), line, code, cvErrorStr(code), err.c_str(), func.c_str());
252252
else
253-
msg = format("OpenCV(%s) %s:%d: error: (%d) %s\n", CV_VERSION, file.c_str(), line, code, err.c_str());
253+
msg = format("OpenCV(%s) %s:%d: error: (%d) %s: %s\n", CV_VERSION, file.c_str(), line, code, cvErrorStr(code), err.c_str());
254254
}
255255

256256
static const char* g_hwFeatureNames[CV_HARDWARE_MAX_FEATURE] = { NULL };

0 commit comments

Comments
 (0)