I have a code like this
var file = java.io.File(source);
try {
var workbook = Packages.jxl.Workbook.getWorkbook(file);
}
catch (exception) {
var msg = "The file is not valid. Please check.";
plugins.dialogs.showErrorDialog("", msg);
return;
}
The getWorkbook() method is supposed get an excel file.
If I pass an image file I suppose the catch block should be executed.
But it just throws the normal servoy error dialog.
jxl.read.biff.BiffException: Unable to recognize OLE stream (local_functions_product_importFromExcel, line 11)