Skip to content

Commit 33b21f1

Browse files
committed
Bug fix
1 parent 2238406 commit 33b21f1

File tree

1 file changed

+8
-4
lines changed
  • components/core/src/clp/streaming_archive/reader

1 file changed

+8
-4
lines changed

components/core/src/clp/streaming_archive/reader/Segment.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77

88
#include <boost/filesystem.hpp>
99

10+
#include "../../ErrorCode.hpp"
1011
#include "../../FileReader.hpp"
1112
#include "../../spdlog_with_specializations.hpp"
13+
#include "../../TraceableException.hpp"
1214

1315
using std::make_unique;
1416
using std::string;
@@ -44,12 +46,14 @@ ErrorCode Segment::try_open(string const& segment_dir_path, segment_id_t segment
4446
}
4547

4648
// Create read-only memory mapped file
47-
m_memory_mapped_segment_file.emplace(segment_path);
48-
if (false == m_memory_mapped_segment_file.has_value()) {
49+
try {
50+
m_memory_mapped_segment_file.emplace(segment_path);
51+
} catch (TraceableException const& ex) {
4952
SPDLOG_ERROR(
5053
"streaming_archive::reader:Segment: Unable to memory map the compressed "
51-
"segment with path: {}",
52-
segment_path.c_str()
54+
"segment with path: {}. Error: {}",
55+
segment_path.c_str(),
56+
ex.what()
5357
);
5458
return ErrorCode_Failure;
5559
}

0 commit comments

Comments
 (0)