Changeset 2280


Ignore:
Timestamp:
02/15/07 14:07:38 (13 years ago)
Author:
curtis
Message:

Better error messages in testRead if OME-XML generation fails
(in particular, if OME-Java is not found).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/FormatReader.java

    r2265 r2280  
    635635        reader.setMetadataStore(ms); 
    636636      } 
    637       catch (Exception exc) { } 
     637      catch (Throwable t) { 
     638        // NB: error messages for missing OME-Java are printed later 
     639      } 
    638640    } 
    639641 
     
    841843      System.out.println("Generating OME-XML"); 
    842844      MetadataStore ms = reader.getMetadataStore(id); 
    843       try { 
    844         Method m = ms.getClass().getMethod("dumpXML", (Class[]) null); 
    845         System.out.println(m.invoke(ms, (Object[]) null)); 
    846         System.out.println(); 
     845 
     846      if (ms.getClass().getName().equals("loci.formats.OMEXMLMetadataStore")) { 
     847        try { 
     848          Method m = ms.getClass().getMethod("dumpXML", (Class[]) null); 
     849          System.out.println(m.invoke(ms, (Object[]) null)); 
     850          System.out.println(); 
     851        } 
     852        catch (Throwable t) { 
     853          System.out.println("Error generating OME-XML:"); 
     854          t.printStackTrace(); 
     855        } 
    847856      } 
    848       catch (Exception exc) { 
    849         System.err.println("OME-XML functionality not available:"); 
    850         exc.printStackTrace(); 
     857      else { 
     858        System.out.println("OME-Java library not found; no OME-XML available"); 
    851859      } 
    852860    } 
Note: See TracChangeset for help on using the changeset viewer.