diff --git a/src/main/java/HandleExtraFileTypes.java b/src/main/java/HandleExtraFileTypes.java index 713abb6..b086cc9 100644 --- a/src/main/java/HandleExtraFileTypes.java +++ b/src/main/java/HandleExtraFileTypes.java @@ -521,20 +521,24 @@ private ImagePlus openImage(final String directory, final String name, (IJ.getVersion().compareTo("1.38j") < 0 || !IJ.redirectingErrorMessages()) && (new File(path).exists())) { - final Object loci = IJ.runPlugIn("loci.plugins.LociImporter", path); - if (loci != null) { - // plugin exists and was launched - try { - // check whether plugin was successful - final Class c = loci.getClass(); - final boolean success = c.getField("success").getBoolean(loci); - final boolean canceled = c.getField("canceled").getBoolean(loci); - if (success || canceled) { - width = IMAGE_OPENED; - return null; + try { + final Object loci = IJ.runPlugIn("loci.plugins.LociImporter", path); + if (loci != null) { + // plugin exists and was launched + // check whether plugin was successful + final Class c = loci.getClass(); + final boolean success = c.getField("success").getBoolean(loci); + final boolean canceled = c.getField("canceled").getBoolean(loci); + if (success || canceled) { + width = IMAGE_OPENED; + return null; + } } } - catch (final Exception exc) {} + catch (final Exception exc) { + IJ.log("Error opening the input in LociImporter who says:\n-----\n" + + exc.getMessage() + "\n-----"); + if (IJ.debugMode) IJ.handleException(exc); } }