Skip to content

Commit 27f59d6

Browse files
committed
Hide exceptions in ~Client
`~Client` can throw producing all sorts for problems. To avoid that, we ignore exceptions in the destructor, similar to how it is done in std::fstream.
1 parent b8544bb commit 27f59d6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

clickhouse/client.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,10 @@ Client::Impl::Impl(const ClientOptions& opts,
289289
}
290290

291291
Client::Impl::~Impl() {
292-
// Wrap up an insert if one is in progress.
293-
EndInsert();
292+
try {
293+
EndInsert();
294+
} catch (...) {
295+
}
294296
}
295297

296298
void Client::Impl::ExecuteQuery(Query query) {

0 commit comments

Comments
 (0)