Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 815c077

Browse files
fix: print error for models get non exists model (#1624)
Co-authored-by: vansangpfiev <sang@jan.ai>
1 parent e3eb215 commit 815c077

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

engine/cli/commands/model_get_cmd.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "httplib.h"
99
#include "server_start_cmd.h"
1010
#include "utils/file_manager_utils.h"
11+
#include "utils/json_helper.h"
1112
#include "utils/logging_utils.h"
1213

1314
namespace commands {
@@ -30,7 +31,8 @@ void ModelGetCmd::Exec(const std::string& host, int port,
3031
if (res->status == httplib::StatusCode::OK_200) {
3132
CLI_LOG(res->body);
3233
} else {
33-
CTL_ERR("Model failed to get with status code: " << res->status);
34+
auto root = json_helper::ParseJsonString(res->body);
35+
CLI_LOG(root["message"].asString());
3436
}
3537
} else {
3638
auto err = res.error();

0 commit comments

Comments
 (0)