Skip to content

Commit

Permalink
fix: print error for models get non exists model (#1624)
Browse files Browse the repository at this point in the history
Co-authored-by: vansangpfiev <sang@jan.ai>
  • Loading branch information
vansangpfiev and sangjanai authored Nov 4, 2024
1 parent e3eb215 commit 815c077
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion engine/cli/commands/model_get_cmd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "httplib.h"
#include "server_start_cmd.h"
#include "utils/file_manager_utils.h"
#include "utils/json_helper.h"
#include "utils/logging_utils.h"

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

0 comments on commit 815c077

Please sign in to comment.