Skip to content
This repository was archived by the owner on Oct 6, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/cpp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,12 @@ int main(int argc, char *argv[]) {
spdlog::set_default_logger(spdlog::stderr_color_st("piper"));

RunConfig runConfig;
parseArgs(argc, argv, runConfig);
try {
parseArgs(argc, argv, runConfig);
} catch (const std::runtime_error& e) {
std::cerr << e.what() << std::endl;
return EXIT_FAILURE;
}

#ifdef _WIN32
// Required on Windows to show IPA symbols
Expand Down Expand Up @@ -540,6 +545,10 @@ void parseArgs(int argc, char *argv[], RunConfig &runConfig) {
}
}

if (runConfig.modelPath.empty()) {
throw runtime_error("Model file is not provided");
}

// Verify model file exists
ifstream modelFile(runConfig.modelPath.c_str(), ios::binary);
if (!modelFile.good()) {
Expand Down