diff --git a/src/clp_ffi_js/ir/IrStreamReader.cpp b/src/clp_ffi_js/ir/IrStreamReader.cpp index 793cb856..93c94e83 100644 --- a/src/clp_ffi_js/ir/IrStreamReader.cpp +++ b/src/clp_ffi_js/ir/IrStreamReader.cpp @@ -163,7 +163,12 @@ auto IrStreamReader::decode_range(size_t begin_idx, size_t end_idx, bool use_fil auto const parsed{log_event.get_message().decode_and_unparse()}; if (false == parsed.has_value()) { SPDLOG_ERROR("Failed to decode message."); - break; + throw ClpFfiJsException{ + clp::ErrorCode::ErrorCode_Failure, + __FILENAME__, + __LINE__, + "Failed to decode message" + }; } message = parsed.value(); diff --git a/src/clp_ffi_js/ir/IrStreamReader.hpp b/src/clp_ffi_js/ir/IrStreamReader.hpp index db83621f..d280a619 100644 --- a/src/clp_ffi_js/ir/IrStreamReader.hpp +++ b/src/clp_ffi_js/ir/IrStreamReader.hpp @@ -91,7 +91,7 @@ class IrStreamReader : public StreamReader { private: // Constructor - explicit IrStreamReader( + IrStreamReader( StreamReaderDataContext&& stream_reader_data_context ); diff --git a/src/clp_ffi_js/ir/StreamReader.cpp b/src/clp_ffi_js/ir/StreamReader.cpp index 452e75ec..286b9cd2 100644 --- a/src/clp_ffi_js/ir/StreamReader.cpp +++ b/src/clp_ffi_js/ir/StreamReader.cpp @@ -2,12 +2,12 @@ #include #include -#include #include #include #include #include +#include #include #include #include @@ -43,7 +43,7 @@ auto StreamReader::create(DataArrayTsType const& data_array) -> std::unique_ptr< new IrStreamReader(std::move(stream_reader_data_context)) ); } - SPDLOG_CRITICAL("Unable to create stream reader for IR data with version {}.", version); + SPDLOG_CRITICAL("Unable to create reader for CLP stream with version {}.", version); throw ClpFfiJsException{ clp::ErrorCode::ErrorCode_Unsupported, diff --git a/src/clp_ffi_js/ir/StreamReaderDataContext.hpp b/src/clp_ffi_js/ir/StreamReaderDataContext.hpp index 651f741f..091b0b05 100644 --- a/src/clp_ffi_js/ir/StreamReaderDataContext.hpp +++ b/src/clp_ffi_js/ir/StreamReaderDataContext.hpp @@ -11,7 +11,7 @@ namespace clp_ffi_js::ir { /** - * The data context for a `IrStreamReader`. It encapsulates a chain of the following resources: + * The data context for a `StreamReader`. It encapsulates a chain of the following resources: * A `clp::ir::LogEventDeserializer` that reads from a * `clp::streaming_compression::zstd::Decompressor`, which in turn reads from a `clp::Array`. * @tparam encoded_variable_t Type of encoded variables encoded in the stream.