From d9c3ebb07e5beb841afa76489124789157423eb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henri=20Hyyryl=C3=A4inen?= Date: Tue, 17 Dec 2024 10:15:58 +0200 Subject: [PATCH] Added better error message when the command file doesn't exist --- src/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 7e43805..13d2259 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -228,6 +228,10 @@ int main(int argc, char* argv[]) try { auto file = std::ifstream(commandFile); + + if(!file.good()) + throw std::runtime_error("failed to open the command file"); + std::stringstream buffer; buffer << file.rdbuf();