From af3304f29eaf1746fc24fb74f7c9fef6e33a20b4 Mon Sep 17 00:00:00 2001 From: Luca Saiu Date: Thu, 1 Sep 2022 16:36:43 +0200 Subject: [PATCH 1/2] add missing #include --- test/test_inspect.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/test/test_inspect.cc b/test/test_inspect.cc index b669f1a..e5cf540 100644 --- a/test/test_inspect.cc +++ b/test/test_inspect.cc @@ -1,5 +1,6 @@ #include #include +#include #include "../src/inspect.hh" #include #include From 2888e26ec62b271e4cb94350cf7ae8ae0f40ba76 Mon Sep 17 00:00:00 2001 From: Luca Saiu Date: Thu, 1 Sep 2022 16:37:18 +0200 Subject: [PATCH 2/2] pEp::Utils::file_read: throw exception instead of calling exit on failure This fixes the JSON server adapter which has just switched from the old slurp module to this functionality, which was not completely compatible because of its way of failing. --- src/std_utils.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/std_utils.cc b/src/std_utils.cc index cb98e7d..6926cf2 100644 --- a/src/std_utils.cc +++ b/src/std_utils.cc @@ -170,8 +170,7 @@ namespace pEp { auto ss = ostringstream{}; ifstream input_file(filename); if (!input_file.is_open()) { - runtime_error e{ "Could not open the file: " + filename }; - exit(EXIT_FAILURE); + throw runtime_error ("Could not open the file: " + filename); } ss << input_file.rdbuf(); return ss.str();