feat: change to exception

This commit is contained in:
3lswear
2022-02-13 22:38:58 +03:00
parent e15ba8b041
commit 4be3ba3f9d

View File

@@ -68,16 +68,15 @@ namespace config
struct s_token Tokenizer::getToken(void)
{
char c;
struct s_token token;
if (file.eof())
{
std::cout << "Tokens exhausted" << std::endl;
throw std::logic_error("Tokens exhausted");
DBOUT << RED << "Tokens exhausted" << ENDL;
throw NoMoreTokens();
}
prev_pos = file.tellg();
c = getWithoutWhiteSpace();
char c = getWithoutWhiteSpace();
if (firstToken() && config::istomlkey(c))
{