Catch no number exception
This commit is contained in:
parent
984d1f3aed
commit
ebfda949ea
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user