Changeset 6673


Ignore:
Timestamp:
07/08/10 15:13:50 (9 years ago)
Author:
curtis
Message:

Better error handling when constructing base reader object.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/loci-plugins/src/loci/plugins/in/ImportProcess.java

    r6654 r6673  
    5656import loci.plugins.util.VirtualReader; 
    5757import loci.plugins.util.WindowTools; 
    58  
    5958import ome.xml.model.enums.DimensionOrder; 
    6059import ome.xml.model.enums.EnumerationException; 
     
    414413 
    415414  /** Performed following ImportStep.READER notification. */ 
    416   private void initializeReader() { 
     415  private void initializeReader() throws FormatException, IOException { 
    417416    computeNameAndLocation(); 
    418417    createBaseReader(); 
     
    534533   * according to the current configuration. 
    535534   */ 
    536   private void createBaseReader() { 
     535  private void createBaseReader() throws FormatException, IOException { 
    537536    if (options.isLocal() || options.isHTTP()) { 
    538537      BF.status(options.isQuiet(), "Identifying " + idName); 
     
    542541        WindowTools.reportException(exc, options.isQuiet(), 
    543542          "Sorry, there was an error reading the file."); 
    544         return; 
     543        throw exc; 
    545544      } 
    546545      catch (IOException exc) { 
    547546        WindowTools.reportException(exc, options.isQuiet(), 
    548547          "Sorry, there was a I/O problem reading the file."); 
    549         return; 
     548        throw exc; 
    550549      } 
    551550    } 
     
    553552      WindowTools.reportException(null, options.isQuiet(), 
    554553        "Sorry, there has been an internal error: unknown data source"); 
     554      cancel(); 
     555      return; 
    555556    } 
    556557    Exception exc = null; 
     
    565566        WindowTools.reportException(exc, options.isQuiet(), 
    566567          "Sorry, there was a problem constructing the OME-XML metadata store"); 
     568        throw new FormatException(exc); 
    567569    } 
    568570    baseReader.setMetadataStore(meta); 
Note: See TracChangeset for help on using the changeset viewer.