diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-09-02 15:55:43 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-09-03 14:59:35 +0200 |
commit | fb5b75a9f3e5551c358d7f948c74406c3d378589 (patch) | |
tree | 7e0d29ad810b25271e3de55d773aae866229b99f /trace/record/record-main-lttng.cc | |
parent | record: Add Client base class (diff) | |
download | rtems-tools-fb5b75a9f3e5551c358d7f948c74406c3d378589.tar.bz2 |
record: Use exceptions
Update #3665.
Diffstat (limited to '')
-rw-r--r-- | trace/record/record-main-lttng.cc | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/trace/record/record-main-lttng.cc b/trace/record/record-main-lttng.cc index 51d4f0e..be2406d 100644 --- a/trace/record/record-main-lttng.cc +++ b/trace/record/record-main-lttng.cc @@ -487,19 +487,23 @@ int main(int argc, char** argv) { } } - GenerateMetadata(); - client.OpenStreamFiles(); + try { + GenerateMetadata(); + client.OpenStreamFiles(); + + if (file != nullptr) { + client.Open(file); + } else { + client.Connect(host, port); + } - if (file != nullptr) { - client.Open(file); - } else { - client.Connect(host, port); + signal(SIGINT, SignalHandler); + client.Run(); + client.Destroy(); + client.CloseStreamFiles(); + } catch (std::exception& e) { + std::cerr << e.what() << std::endl; } - signal(SIGINT, SignalHandler); - client.Run(); - client.Destroy(); - client.CloseStreamFiles(); - return 0; } |