feat: change to domain_error and cleanup

This commit is contained in:
3lswear
2022-02-27 18:13:17 +03:00
parent c8d82c92a1
commit 6341d4d47f

View File

@@ -53,8 +53,7 @@ namespace config
file.open(filename, std::ios::in);
if (!file.good())
{
std::cerr << "file didn't open" << std::endl;
throw std::logic_error("file didnt open");
throw std::domain_error("Invalid arguments");
}
}
bool Tokenizer::firstToken()
@@ -130,7 +129,6 @@ namespace config
file.get(c);
}
if (c != ']')
// throw std::logic_error("malformed MAP_DECL");
throw InvalidToken(token.value);
}
}
@@ -152,7 +150,6 @@ namespace config
if (file.eof())
{
file.clear();
DBOUT << "cleared" <<ENDL;
}
else if (c != '\n')
file.seekg(-1, std::ios_base::cur);