Skip to content

Commit f555421

Browse files
committed
refactor: main loop function
1 parent 73ec5b7 commit f555421

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/index.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,18 @@ async function mainLoop() {
1313
const answer = await terminalController.question();
1414
if (answer === STOP_TERM) {
1515
terminalController.closeTerminal();
16-
console.log("processo finalizado");
16+
console.log("process finished!");
1717
return;
1818
}
1919
const person = Person.generateInstanceFromString(answer);
20-
} catch (error) {}
20+
terminalController.updateTable(person.formatted(DEFAULT_LANG));
21+
await save(person);
22+
23+
return mainLoop();
24+
} catch (error) {
25+
console.error("DEU RUIM**", error);
26+
return mainLoop();
27+
}
2128
}
29+
30+
await mainLoop();

0 commit comments

Comments
 (0)