Skip to content

Commit 1959d80

Browse files
Update mooncake-common/src/default_config.cpp
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 3d4b0dc commit 1959d80

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mooncake-common/src/default_config.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ void DefaultConfig::loadFromJSON() {
4747
Json::Value root;
4848
std::ifstream file;
4949
file.open(path_);
50+
if (!file.is_open()) {
51+
throw std::runtime_error("Failed to open JSON file: " + path_);
52+
}
5053

5154
// Read entire file into string
5255
std::string json_content((std::istreambuf_iterator<char>(file)),

0 commit comments

Comments
 (0)