Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,21 @@
import java.io.IOException;
import java.io.UncheckedIOException;

import tech.ydb.topic.description.Codec;

/**
* @author Nikolay Perfilov
*/
public class DecompressionException extends UncheckedIOException {
private static final long serialVersionUID = 2720187645859527813L;

private final byte[] rawData;
public DecompressionException(String message, IOException cause, byte[] rawData) {
private final Codec codec;

public DecompressionException(String message, IOException cause, byte[] rawData, Codec codec) {
super(message, cause);
this.rawData = rawData;
this.codec = codec;
}

/**
Expand All @@ -21,4 +26,11 @@ public DecompressionException(String message, IOException cause, byte[] rawData)
public byte[] getRawData() {
return rawData;
}

/**
* @return Codec of message byte data
*/
public Codec getCodec() {
return codec;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private MessageImpl(Builder builder) {
public byte[] getData() {
if (exception != null) {
throw new DecompressionException("Error occurred while decoding a message",
exception, data);
exception, data, batchMeta.getCodec());
}
return data;
}
Expand Down