Give a reasonable error message on Excel 95 import failure - fixes #564

This commit is contained in:
Tom Morris 2013-07-26 16:24:56 -04:00
parent ff4eeb549a
commit 7edc550618
2 changed files with 9 additions and 0 deletions

View File

@ -115,6 +115,8 @@ public class ExcelImporter extends TabularImportingParserBase {
}
} catch (IOException e) {
logger.error("Error generating parser UI initialization data for Excel file", e);
} catch (IllegalArgumentException e) {
logger.error("Error generating parser UI initialization data for Excel file (only Excel 97 & later supported)", e);
}
return options;
@ -153,6 +155,13 @@ public class ExcelImporter extends TabularImportingParserBase {
e
));
return;
} catch (IllegalArgumentException e) {
exceptions.add(new ImportException(
"Attempted to parse as an Excel file but failed. " +
"Only Excel 97 and later formats are supported.",
e
));
return;
}
int[] sheets = JSONUtilities.getIntArray(options, "sheets");