Обновление example с проверкой исключений.
This commit is contained in:
parent
057b62b58e
commit
5bd192a788
1 changed files with 17 additions and 3 deletions
|
|
@ -4,7 +4,21 @@ import std.stdio : writeln;
|
|||
|
||||
void main()
|
||||
{
|
||||
auto config = SessionConfig(InputMode.raw, Cursor.normal, Echo.on);
|
||||
auto session = new Session(config);
|
||||
auto config = SessionConfig(InputMode.raw, Cursor.normal, Echo.on, Keypad.on);
|
||||
Session session;
|
||||
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");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue