From 896459bdfa4982fa1af5949d92348d1cf1cb73f5 Mon Sep 17 00:00:00 2001 From: zekexiao Date: Thu, 15 Jan 2026 23:44:48 +0800 Subject: [PATCH] Add error info --- cli/main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cli/main.cpp b/cli/main.cpp index efc6b19..5e5895a 100644 --- a/cli/main.cpp +++ b/cli/main.cpp @@ -10,7 +10,11 @@ int main(int argc, char** argv) { } std::chrono::high_resolution_clock::time_point start = std::chrono::high_resolution_clock::now(); camellya::State state; - state.do_file(argv[1]); + bool success = state.do_file(argv[1]); + if (!success) { + std::cerr << "Error: " << state.get_error() << std::endl; + return 1; + } std::chrono::high_resolution_clock::time_point end = std::chrono::high_resolution_clock::now(); std::chrono::duration duration = end - start; std::cout << std::format("Execution completed in {} seconds. \n", duration.count()) << std::endl;