diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index 1f20e5a94..603f86b72 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -115,7 +115,11 @@ bool CppCheck::findError(std::string code, const char FileName[]) // is still there. code = previousCode.substr(found+9); _errorList.clear(); - checkFile(code, FileName); + try { + checkFile(code, FileName); + } catch (ErrorLogger::ErrorMessage &err) { + reportErr(err); + } } if (_errorList.empty()) {