Skip to content

Commit

Permalink
Added better error message when the command file doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
hhyyrylainen committed Dec 17, 2024
1 parent cbc0c09 commit d9c3ebb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit d9c3ebb

Please sign in to comment.