]> source.dussan.org Git - poi.git/commitdiff
made the exception meaningful
authorAndrew C. Oliver <acoliver@apache.org>
Sun, 21 Jul 2002 13:08:18 +0000 (13:08 +0000)
committerAndrew C. Oliver <acoliver@apache.org>
Sun, 21 Jul 2002 13:08:18 +0000 (13:08 +0000)
PR:
Obtained from:
Submitted by:
Reviewed by:

git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352802 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/hssf/eventmodel/HSSFEventFactory.java

index c935a60eda01ae5d71aebc9e82c43a2f610e7858..a18ac3a4f69e603677734a2e42b3a746cfdea7a0 100644 (file)
@@ -172,6 +172,8 @@ public class HSSFEventFactory
                throws IOException, HSSFUserException
        {
                short userCode = 0;
+
+               short sid = 0;
                process:
                try
                {
@@ -181,7 +183,6 @@ public class HSSFEventFactory
 
                        while (bytesread > 0)
                        {
-                               short sid = 0;
 
                                sid = LittleEndian.getShort(sidbytes);
                                if ((rec != null) && (sid != ContinueRecord.sid))
@@ -238,7 +239,8 @@ public class HSSFEventFactory
                }
                catch (IOException e)
                {
-                       throw new RecordFormatException("Error reading bytes");
+                       throw new RecordFormatException("Error reading bytes" +
+                        "while processing record sid="+sid);
                }
                return userCode;