From 12b7bf1c16f671c83840961c37a339141a7ffbb3 Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Thu, 4 Apr 2024 14:32:40 +0200 Subject: improved assert (#37) - Improvement: Add file and line to ASSERT exceptions - Improvement: Catch call stack when throwing assert exceptions and log/output call stack at important places to provide more context to caller --- src/zenstore/blockstore.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/zenstore/blockstore.cpp') diff --git a/src/zenstore/blockstore.cpp b/src/zenstore/blockstore.cpp index dfa852434..a576ff022 100644 --- a/src/zenstore/blockstore.cpp +++ b/src/zenstore/blockstore.cpp @@ -915,7 +915,7 @@ BlockStore::ReclaimSpace(const ReclaimSnapshotState& Snapshot, NewBlockFile = nullptr; } } - catch (std::system_error& SystemError) + catch (const std::system_error& SystemError) { if (IsOOM(SystemError.code())) { @@ -930,11 +930,11 @@ BlockStore::ReclaimSpace(const ReclaimSnapshotState& Snapshot, ZEN_ERROR("reclaiming space for '{}' failed with system error exception: '{}'", m_BlocksBasePath, SystemError.what()); } } - catch (std::bad_alloc& BadAlloc) + catch (const std::bad_alloc& BadAlloc) { ZEN_WARN("reclaiming space for '{}' ran out of memory: '{}'", m_BlocksBasePath, BadAlloc.what()); } - catch (std::exception& ex) + catch (const std::exception& ex) { ZEN_ERROR("reclaiming space for '{}' failed with: '{}'", m_BlocksBasePath, ex.what()); } -- cgit v1.2.3