Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions components/core/src/clp/clp/FileCompressor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,9 +451,9 @@ bool FileCompressor::compress_ir_stream(
ReaderInterface& reader
) {
bool uses_four_byte_encoding{false};
auto ir_error_code = ffi::ir_stream::get_encoding_type(reader, uses_four_byte_encoding);
if (ffi::ir_stream::IRErrorCode_Success != ir_error_code) {
SPDLOG_ERROR("Cannot compress {}, IR error={}", path, static_cast<int>(ir_error_code));
auto result = ffi::ir_stream::get_encoding_type(reader, uses_four_byte_encoding);
if (result.has_error()) {
SPDLOG_ERROR("Cannot compress {}, IR error={}", path, result.error().message());
return false;
}

Expand Down
17 changes: 3 additions & 14 deletions components/core/src/clp/ffi/ir_stream/Deserializer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,19 +239,11 @@ auto Deserializer<IrUnitHandlerType, QueryHandlerType>::create_generic(
QueryHandlerType query_handler
) -> ystdlib::error_handling::Result<Deserializer> {
bool is_four_byte_encoded{};
if (auto const err{get_encoding_type(reader, is_four_byte_encoded)};
IRErrorCode::IRErrorCode_Success != err)
{
return ir_error_code_to_errc(err);
}
YSTDLIB_ERROR_HANDLING_TRYV(get_encoding_type(reader, is_four_byte_encoded));

std::vector<int8_t> metadata;
encoded_tag_t metadata_type{};
if (auto const err{deserialize_preamble(reader, metadata_type, metadata)};
IRErrorCode::IRErrorCode_Success != err)
{
return ir_error_code_to_errc(err);
}
YSTDLIB_ERROR_HANDLING_TRYV(deserialize_preamble(reader, metadata_type, metadata));

if (cProtocol::Metadata::EncodingJson != metadata_type) {
return std::errc::protocol_not_supported;
Expand Down Expand Up @@ -293,10 +285,7 @@ auto Deserializer<IrUnitHandler, QueryHandlerType>::deserialize_next_ir_unit(
return std::errc::operation_not_permitted;
}

encoded_tag_t tag{};
if (auto const err{deserialize_tag(reader, tag)}; IRErrorCode::IRErrorCode_Success != err) {
return ir_error_code_to_errc(err);
}
auto tag{YSTDLIB_ERROR_HANDLING_TRYX(deserialize_tag(reader))};

auto const optional_ir_unit_type{get_ir_unit_type_from_tag(tag)};
if (false == optional_ir_unit_type.has_value()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ auto IrErrorCategory::message(IrDeserializationErrorEnum error_enum) const -> st
return "incomplete IR stream";
case IrDeserializationErrorEnum::InvalidKeyGroupOrdering:
return "invalid key-ID-group ordering";
case IrDeserializationErrorEnum::InvalidMagicNumber:
return "IR stream starts with an invalid magic number";
case IrDeserializationErrorEnum::InvalidTag:
return "invalid tag";
case IrDeserializationErrorEnum::MessageDecodingFailure:
return "message decoding failed";
case IrDeserializationErrorEnum::UnsupportedMetadataFormat:
return "IR stream metadata format unsupported";
case IrDeserializationErrorEnum::UnsupportedVersion:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ enum class IrDeserializationErrorEnum : uint8_t {
EndOfStream,
IncompleteStream,
InvalidKeyGroupOrdering,
InvalidMagicNumber,
InvalidTag,
MessageDecodingFailure,
UnsupportedMetadataFormat,
UnsupportedVersion,
UnknownSchemaTreeNodeType,
Expand Down
Loading
Loading