From 411eaa199932b4f9f3b670aa85c762036cc31f58 Mon Sep 17 00:00:00 2001 From: adjoly Date: Sat, 12 Jul 2025 22:00:16 +0200 Subject: [PATCH] =?UTF-8?q?=E3=80=8C=F0=9F=94=A8=E3=80=8D=20fix:=20fixed?= =?UTF-8?q?=20issue=20with=20exception=20not=20thrown=20properly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tomlpp | 2 +- src/config/Config.cpp | 7 ++++--- src/main.cpp | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/tomlpp b/lib/tomlpp index c20cb5e..9930415 160000 --- a/lib/tomlpp +++ b/lib/tomlpp @@ -1 +1 @@ -Subproject commit c20cb5e4d262fbfc01301da9ea12748f927cc711 +Subproject commit 9930415a3fdaf5d1b2f8fa84465087703be614ee diff --git a/src/config/Config.cpp b/src/config/Config.cpp index 3654b97..e678f26 100644 --- a/src/config/Config.cpp +++ b/src/config/Config.cpp @@ -6,7 +6,7 @@ /* By: adjoly +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* 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(); diff --git a/src/main.cpp b/src/main.cpp index 2361b93..ed534f8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,7 +6,7 @@ /* By: mmoussou