From 88526f9528c0bedc2a77cbf2ded3df71c8f9e5e7 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Tue, 19 Sep 2023 07:37:38 +0900 Subject: [PATCH] Add exception handlings The generated code can throw InvalidIOException and std::bad_weak_ptr exceptions. This patch adds exception handlings. Change-Id: I91e4d1fecab9e4e9a2047efe47f4616a396b9b00 Signed-off-by: Hwankyu Jhun --- benchmark/tool/main.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/benchmark/tool/main.cc b/benchmark/tool/main.cc index 8abe412..1fae0e2 100644 --- a/benchmark/tool/main.cc +++ b/benchmark/tool/main.cc @@ -183,7 +183,16 @@ class Tester { } // namespace int main(int argc, char** argv) { - Tester tester; - tester.Run(argc, argv); + try { + Tester tester; + tester.Run(argc, argv); + } catch (const rpc_port::BenchmarkProxy::proxy::InvalidIOException& ie) { + _E("InvalidIOException occurs"); + return -1; + } catch (const std::bad_weak_ptr& be) { + _E("bad_weak_ptr occurs. error(%s)", be.what()); + return -1; + } + return 0; } -- 2.7.4