| 50 | }; |
| 51 | |
| 52 | class UnknownInputButton : public Exception |
| 53 | { |
| 54 | public: |
| 55 | UnknownInputButton(std::string_view buttonName, |
| 56 | const std::vector<std::string>& existingButtons, DebugInfo info) |
| 57 | : Exception("UnknownInputButton", info) |
| 58 | { |
| 59 | this->error("InputButton named '{}' does not exists", buttonName); |
| 60 | std::vector<std::string> suggestions |
| 61 | = Utils::String::sortByDistance(buttonName.data(), existingButtons, 5); |
| 62 | std::transform(suggestions.begin(), suggestions.end(), suggestions.begin(), |
| 63 | &Utils::String::quote); |
| 64 | this->hint("Try one of the following InputButton : ({}...)", |
| 65 | fmt::join(suggestions, ", ")); |
| 66 | } |
| 67 | }; |
| 68 | |
| 69 | class InvalidInputCombinationCode : public Exception |
| 70 | { |
no outgoing calls
no test coverage detected