aboutsummaryrefslogtreecommitdiffstats
path: root/nihil.cli/command_node.cc
diff options
context:
space:
mode:
Diffstat (limited to 'nihil.cli/command_node.cc')
-rw-r--r--nihil.cli/command_node.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/nihil.cli/command_node.cc b/nihil.cli/command_node.cc
index 98aeac1..dd18716 100644
--- a/nihil.cli/command_node.cc
+++ b/nihil.cli/command_node.cc
@@ -9,6 +9,8 @@ module;
#include <print>
#include <string>
+#include <unistd.h>
+
module nihil.cli;
import nihil.core;
@@ -16,9 +18,14 @@ import nihil.error;
namespace nihil {
+//NOLINTNEXTLINE(bugprone-exception-escape)
command_node::command_node(std::string_view path) noexcept
- : m_path(path)
+try : m_path(path)
{
+} catch (std::exception const &exc) {
+ std::fprintf(stderr, "%s\n", exc.what());
+ _exit(1);
+ /*NOTREACHED*/
}
command_node::~command_node()