From e5b95cc5a11b281a585de18e0cbc1deb401cf954 Mon Sep 17 00:00:00 2001 From: Steve Malton Date: Tue, 5 Dec 2023 16:15:43 +0000 Subject: [PATCH] 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