You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2025/01/01 15:25:36 UTC

(commons-compress) branch master updated: Better error message

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git


The following commit(s) were added to refs/heads/master by this push:
     new 341fa59be Better error message
341fa59be is described below

commit 341fa59bedcab5ecaa3f2ba39e95e59346d7aea1
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Jan 1 10:25:31 2025 -0500

    Better error message
---
 .../commons/compress/compressors/bzip2/BZip2CompressorInputStream.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java b/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
index bdf9ed6e2..c9fbab7da 100644
--- a/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
@@ -527,7 +527,7 @@ public class BZip2CompressorInputStream extends CompressorInputStream implements
         final int magic2 = readNextByte(this.bin);
 
         if (magic0 != 'B' || magic1 != 'Z' || magic2 != 'h') {
-            throw new IOException(isFirstStream ? "Stream is not in the BZip2 format" : "Garbage after a valid BZip2 stream");
+            throw new IOException(isFirstStream ? "Stream is not in the BZip2 format" : "Unexpected data after a valid BZip2 stream");
         }
 
         final int blockSize = readNextByte(this.bin);