Обновление example с проверкой исключений.

This commit is contained in:
Alexander Zhirov 2026-01-05 01:05:38 +03:00
parent 057b62b58e
commit 5bd192a788
Signed by: alexander
GPG key ID: C8D8BE544A27C511

View file

@ -4,7 +4,21 @@ import std.stdio : writeln;
void main() void main()
{ {
auto config = SessionConfig(InputMode.raw, Cursor.normal, Echo.on); auto config = SessionConfig(InputMode.raw, Cursor.normal, Echo.on, Keypad.on);
auto session = new Session(config); Session session;
session.close(); try {
session = new Session(config);
} catch (Exception e) {
writeln("Не удалось инициализировать сессию:\n\t", e.msg);
return;
}
try {
session.close();
} catch (Exception e) {
writeln("Не удалось закрыть сессию:\n\t", e.msg);
return;
}
writeln("OK");
} }