mirror of
https://github.com/KeyZox71/webserv.git
synced 2025-07-15 19:46:32 +02:00
「🔨」 fix: fixed issue with exception not thrown properly
This commit is contained in:
Submodule lib/tomlpp updated: c20cb5e4d2...9930415a3f
@ -6,7 +6,7 @@
|
||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/14 12:53:54 by adjoly #+# #+# */
|
||||
/* Updated: 2025/06/23 20:36:47 by adjoly ### ########.fr */
|
||||
/* Updated: 2025/07/12 21:40:21 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -27,11 +27,12 @@ Config::Config(std::string &filename) {
|
||||
|
||||
try {
|
||||
file->parse();
|
||||
} catch (std::exception &e) {
|
||||
} catch (const std::exception &e) {
|
||||
// if (file->getParsedFile() != not_nullptr)
|
||||
// delete file->getParsedFile();
|
||||
std::runtime_error excep(e.what());
|
||||
delete file;
|
||||
throw e;
|
||||
throw excep;
|
||||
}
|
||||
toml::ANode *table = file->getParsedFile();
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/03 15:45:07 by mmoussou #+# #+# */
|
||||
/* Updated: 2025/06/23 20:35:27 by adjoly ### ########.fr */
|
||||
/* Updated: 2025/07/12 21:38:36 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -70,7 +70,7 @@ int main(int ac, char **av) {
|
||||
str = av[1];
|
||||
}
|
||||
config::_conf = new config::Config(str);
|
||||
} catch (std::exception &e) {
|
||||
} catch (const std::exception &e) {
|
||||
Logger log;
|
||||
log.error(e.what());
|
||||
if (_log != not_nullptr)
|
||||
|
Reference in New Issue
Block a user