| 75 | }; |
| 76 | |
| 77 | class UnknownTriggerGroup : public Exception |
| 78 | { |
| 79 | public: |
| 80 | UnknownTriggerGroup(std::string_view triggerNamespace, |
| 81 | std::string_view triggerGroup, const std::vector<std::string>& existingGroups, |
| 82 | DebugInfo info) |
| 83 | : Exception("UnknownTriggerGroup", info) |
| 84 | { |
| 85 | this->error( |
| 86 | "Unable to find a TriggerGroup named '{}' inside TriggerNamespace '{}'", |
| 87 | triggerGroup, triggerNamespace); |
| 88 | std::vector<std::string> suggestions |
| 89 | = Utils::String::sortByDistance(triggerGroup.data(), existingGroups, 5); |
| 90 | std::transform(suggestions.begin(), suggestions.end(), suggestions.begin(), |
| 91 | Utils::String::quote); |
| 92 | this->hint("Try one of the following TriggerGroups ({}...)", |
| 93 | fmt::join(suggestions, ", ")); |
| 94 | } |
| 95 | }; |
| 96 | |
| 97 | class TriggerNamespaceAlreadyExists : public Exception |
| 98 | { |
no outgoing calls
no test coverage detected