Catch no number exception

This commit is contained in:
Love 2025-01-24 13:00:30 +01:00
parent 984d1f3aed
commit ebfda949ea

View File

@ -54,7 +54,14 @@ void Tui::run() {
for (;;) {
std::cout << "Enter a command: ";
std::flush(std::cout);
const Command::Command command = Command::readCommand();
Command::Command command;
try {
command = Command::readCommand();
} catch (const Command::NoNumberException &e) {
std::cout << e.what() << std::endl;
continue;
}
bool should_exit = false;
auto visitor = [this, &should_exit]<typename T0>(T0 &&arg) {