Skip to content

Commit

Permalink
Remove is_error invokation on function return with valid negative values
Browse files Browse the repository at this point in the history
  • Loading branch information
jklamer committed Sep 25, 2024
1 parent befc81b commit f998484
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/io/airlift/compress/v3/zstd/ZstdNative.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ public static long decompressedLength(MemorySegment compressed, long compressedL
throw new Error("Unexpected exception", e);
}

if (isError(result)) {
// -1 is valid return for content size unknown
if (result < -1) {
throw new IllegalArgumentException("Unknown error occurred during decompression: " + getErrorName(result));
}
return result;
Expand Down

0 comments on commit f998484

Please sign in to comment.