Bug 17890 - [RFE] Better Error Message when file read is zero bytes
Summary: [RFE] Better Error Message when file read is zero bytes
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: POIFS (show other bugs)
Version: 2.0-dev
Hardware: All other
: P3 enhancement (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-11 19:26 UTC by Danny Mui
Modified: 2006-07-25 05:17 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Danny Mui 2003-03-11 19:26:09 UTC
The following exception is generated when trying to read a file that zero bytes:

========================================
java.io.IOException: Unable to read entire header; -1 bytes read; expected
512 bytes
	at
org.apache.poi.poifs.storage.HeaderBlockReader.<init>(HeaderBlockReader.java:114)
	at
org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSystem.java
========================================

Provide a more descriptive exception message.
Comment 1 Jason Height 2006-07-25 12:17:37 UTC
Modified to print 0 instead of -1. Makes a bit more sense, hopefully that is
sufficient, if not reopen with a comment as to desired error text.

java.io.IOException: Unable to read entire header; 0 bytes read; expected
512 bytes

Jason