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