Additional error dialog for Issue 188

git-svn-id: http://google-refine.googlecode.com/svn/trunk@1858 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
Iain Sproat 2010-11-11 14:25:46 +00:00
parent 2f564589f5
commit 74e9288229

View File

@ -78,10 +78,17 @@ public class ExcelImporter implements StreamImporter {
new HSSFWorkbook(new POIFSFileSystem(inputStream)); new HSSFWorkbook(new POIFSFileSystem(inputStream));
} catch (IOException e) { } catch (IOException e) {
throw new ImportException( throw new ImportException(
"Attempted to parse file as Excel file but failed. " + "Attempted to parse as an Excel file but failed. " +
"Try to use Excel to re-save the file as a different Excel version or as TSV and upload again.", "Try to use Excel to re-save the file as a different Excel version or as TSV and upload again.",
e e
); );
} catch (ArrayIndexOutOfBoundsException e){
throw new ImportException(
"Attempted to parse file as an Excel file but failed. " +
"This is probably caused by a corrupt excel file, or due to the file having previously been created or saved by a non-Microsoft application. " +
"Please try opening the file in Microsoft Excel and resaving it, then try re-uploading the file. " +
"See https://issues.apache.org/bugzilla/show_bug.cgi?id=48261 for further details",
e);
} }
Sheet sheet = wb.getSheetAt(0); Sheet sheet = wb.getSheetAt(0);