Skip to content

Commit

Permalink
junhao changes
Browse files Browse the repository at this point in the history
  • Loading branch information
davemarco committed Nov 4, 2024
1 parent dba3910 commit 9ddd974
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
7 changes: 6 additions & 1 deletion src/clp_ffi_js/ir/IrStreamReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion src/clp_ffi_js/ir/IrStreamReader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class IrStreamReader : public StreamReader {

private:
// Constructor
explicit IrStreamReader(
IrStreamReader(
StreamReaderDataContext<four_byte_encoded_variable_t>&& stream_reader_data_context
);

Expand Down
4 changes: 2 additions & 2 deletions src/clp_ffi_js/ir/StreamReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

#include <cstddef>
#include <cstdint>
#include <ErrorCode.hpp>
#include <format>
#include <memory>
#include <utility>

#include <clp/Array.hpp>
#include <clp/ErrorCode.hpp>
#include <clp/streaming_compression/zstd/Decompressor.hpp>
#include <clp/TraceableException.hpp>
#include <emscripten/bind.h>
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/clp_ffi_js/ir/StreamReaderDataContext.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 9ddd974

Please sign in to comment.