Skip to content

Commit

Permalink
Split error message to wrap suggestions without duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
malton-ont committed Dec 5, 2023
1 parent 66ba4ba commit e5b95cc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions dorado/models/models.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,11 @@ ModelInfo find_model(const std::vector<ModelInfo>& 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
Expand Down

0 comments on commit e5b95cc

Please sign in to comment.