From dc1d9ae97378542bb57a9a9fd7c01d2b49f6de15 Mon Sep 17 00:00:00 2001 From: native-api Date: Tue, 6 Mar 2018 09:58:19 +0300 Subject: [PATCH] Include error code description into the message (#10982) --- modules/core/src/system.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/core/src/system.cpp b/modules/core/src/system.cpp index 36a3ecc724..11e12b0724 100644 --- a/modules/core/src/system.cpp +++ b/modules/core/src/system.cpp @@ -248,9 +248,9 @@ const char* Exception::what() const throw() { return msg.c_str(); } void Exception::formatMessage() { if( func.size() > 0 ) - 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()); + 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()); else - msg = format("OpenCV(%s) %s:%d: error: (%d) %s\n", CV_VERSION, file.c_str(), line, code, err.c_str()); + msg = format("OpenCV(%s) %s:%d: error: (%d) %s: %s\n", CV_VERSION, file.c_str(), line, code, cvErrorStr(code), err.c_str()); } static const char* g_hwFeatureNames[CV_HARDWARE_MAX_FEATURE] = { NULL };