mirror of
https://github.com/3lswear/webserv.git
synced 2025-10-28 21:07:59 +03:00
feat: change to domain_error and cleanup
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user