Refactoring: Don't throw exceptions in the tokenizer upon errors. Ticket: #1866
This commit is contained in:
parent
5e0a4a173a
commit
8a0d989190
|
@ -6965,14 +6965,7 @@ void Tokenizer::syntaxError(const Token *tok, char c)
|
|||
{
|
||||
std::ostringstream err;
|
||||
err << "### Unlogged error at Tokenizer::syntaxError: Invalid number of character (" << c << ")";
|
||||
if (_settings && _settings->_debug)
|
||||
{
|
||||
throw std::runtime_error(err.str());
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << err.str() << std::endl;
|
||||
}
|
||||
std::cerr << err.str() << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -7008,14 +7001,7 @@ void Tokenizer::cppcheckError(const Token *tok) const
|
|||
{
|
||||
std::ostringstream err;
|
||||
err << "### Unlogged error at Tokenizer::cppcheckError";
|
||||
if (_settings && _settings->_debug)
|
||||
{
|
||||
throw std::runtime_error(err.str());
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << err.str() << std::endl;
|
||||
}
|
||||
std::cerr << err.str() << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue