From: Xuan-Son Nguyen Date: Wed, 13 May 2026 13:14:58 +0000 (+0200) Subject: download: do not exit() on error (#23008) X-Git-Tag: upstream/0.0.10438~1304 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=e75cd5efb5bd88328725cf6d19da4d26f2b5059e;p=pkg%2Fggml%2Fsources%2Fllama.cpp download: do not exit() on error (#23008) --- diff --git a/common/arg.cpp b/common/arg.cpp index f1f4c12a3..75a4d38d3 100644 --- a/common/arg.cpp +++ b/common/arg.cpp @@ -357,8 +357,7 @@ static handle_model_result common_params_handle_model(struct common_params_model auto download_result = common_download_model(model, opts, true); if (download_result.model_path.empty()) { - LOG_ERR("error: failed to download model from Hugging Face\n"); - exit(1); + throw std::runtime_error("failed to download model from Hugging Face"); } model.name = model.hf_repo; @@ -380,8 +379,7 @@ static handle_model_result common_params_handle_model(struct common_params_model opts.offline = offline; auto download_result = common_download_model(model, opts); if (download_result.model_path.empty()) { - LOG_ERR("error: failed to download model from %s\n", model.url.c_str()); - exit(1); + throw std::runtime_error("failed to download model from " + model.url); } }