From ecdbfc62969e202199e79ec714200739ff0f09e6 Mon Sep 17 00:00:00 2001 From: Steve Malton Date: Tue, 5 Dec 2023 16:14:51 +0000 Subject: [PATCH 1/3] Fix invalid trace message format --- dorado/data_loader/ModelFinder.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dorado/data_loader/ModelFinder.cpp b/dorado/data_loader/ModelFinder.cpp index f12045d3..1388108a 100644 --- a/dorado/data_loader/ModelFinder.cpp +++ b/dorado/data_loader/ModelFinder.cpp @@ -43,8 +43,8 @@ ModelSelection ModelComplexParser::parse(const std::string& arg) { spdlog::trace("Model option: '{}' unknown - assuming path", variant_str); selection.model = ModelVariantPair{model_variant}; } else { - spdlog::trace("'{}' found variant: '{}' and version: '{}'", variant_str), - to_string(model_variant), to_string(version); + spdlog::trace("'{}' found variant: '{}' and version: '{}'", variant_str, + to_string(model_variant), to_string(version)); selection.model = ModelVariantPair{model_variant, version}; } } else { From 66ba4ba68f4471c15f6f6f8b5dd5bf7ea0b6270c Mon Sep 17 00:00:00 2001 From: Steve Malton Date: Tue, 5 Dec 2023 16:15:24 +0000 Subject: [PATCH 2/3] Fix message case --- dorado/models/models.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dorado/models/models.cpp b/dorado/models/models.cpp index f2ccf3de..6bf15635 100644 --- a/dorado/models/models.cpp +++ b/dorado/models/models.cpp @@ -81,7 +81,7 @@ void suggest_models(const std::vector& models, const ModelVariantPair& model, const ModsVariantPair& mods) { if (Chemistry::NONE == chemistry) { - throw std::runtime_error("cannot get model without chemistry"); + throw std::runtime_error("Cannot get model without chemistry"); } if (mods.has_variant()) { @@ -154,7 +154,7 @@ ModelInfo find_model(const std::vector& models, const ModsVariantPair& mods, bool suggestions) { if (Chemistry::NONE == chemistry) { - throw std::runtime_error("cannot get model without chemistry"); + throw std::runtime_error("Cannot get model without chemistry"); } const auto matches = find_models(models, chemistry, model, mods); From e5b95cc5a11b281a585de18e0cbc1deb401cf954 Mon Sep 17 00:00:00 2001 From: Steve Malton Date: Tue, 5 Dec 2023 16:15:43 +0000 Subject: [PATCH 3/3] Split error message to wrap suggestions without duplication --- dorado/models/models.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dorado/models/models.cpp b/dorado/models/models.cpp index 6bf15635..58489568 100644 --- a/dorado/models/models.cpp +++ b/dorado/models/models.cpp @@ -159,13 +159,11 @@ ModelInfo find_model(const std::vector& models, const auto matches = find_models(models, chemistry, model, mods); if (matches.empty()) { + spdlog::error("Failed to get {} model", description); if (suggestions) { - spdlog::error("Failed to get {} model. No matches for {}", description, - format_msg(chemistry, model, mods)); suggest_models(models, description, chemistry, model, mods); } - throw std::runtime_error("Failed to get " + description + " model. No matches for " + - format_msg(chemistry, model, mods)); + throw std::runtime_error("No matches for " + format_msg(chemistry, model, mods)); } // Get the only match or the latest model