Changeset 3378


Ignore:
Timestamp:
11/16/07 12:08:29 (13 years ago)
Author:
curtis
Message:

Throw a proper FormatException for various problems.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/codec/JPEGCodec.java

    r3370 r3378  
    8585        Object jpeg = registry.getServiceProviderByClass(jpegSpi); 
    8686 
     87        if (jpeg == null) { 
     88          throw new FormatException("Cannot locate JPEG decoder"); 
     89        } 
    8790        javax.imageio.ImageReader r = 
    8891          ((ImageReaderSpi) jpeg).createReaderInstance(); 
     
    97100      } 
    98101      catch (IOException e) { 
    99         LogTools.println("An I/O error occurred while decompressing image. " + 
    100           "Stack dump follows:"); 
    101         LogTools.trace(e); 
    102         return null; 
     102        throw new FormatException( 
     103          "An I/O error occurred while decompressing the image", e); 
    103104      } 
    104105      catch (ClassNotFoundException e) { 
    105         LogTools.println("An I/O error occurred while decompressing image. " + 
    106           "Stack dump follows:"); 
    107         LogTools.trace(e); 
    108         return null; 
     106        throw new FormatException( 
     107          "An I/O error occurred while decompressing the image", e); 
    109108      } 
    110109    } 
Note: See TracChangeset for help on using the changeset viewer.