Changeset 403

Show
Ignore:
Timestamp:
09/29/08 20:49:00 (3 months ago)
Author:
arneke
Message:

Throw more exceptions, for invalid resolutions and output formats

Location:
trunk/geowebcache/src/main/java/org/geowebcache
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/geowebcache/src/main/java/org/geowebcache/layer/GridCalculator.java

    r399 r403  
    1616 */ 
    1717package org.geowebcache.layer; 
     18 
     19import java.util.Arrays; 
    1820 
    1921import org.apache.commons.logging.Log; 
     
    467469        //low = 0; 
    468470        //high = resolutions.length - 1; 
    469          
    470         while (low <= high) { 
     471 
     472        // Lets be generous and not calculate log 
     473        int maxCount = resolutions.length / 2; 
     474         
     475        while (low <= high && maxCount > 0) { 
     476                maxCount--; 
    471477            int mid = (low + high) >>> 1; 
    472478             
     
    484490            } 
    485491        } 
    486         throw new BadTileException("Oops. Should never get here."); 
     492        throw new BadTileException("The bounds resulted in a resolution of "  
     493                        + reqResolution + " which does not match any of the available ones " 
     494                        + Arrays.toString(resolutions)); 
    487495    } 
    488496     
  • trunk/geowebcache/src/main/java/org/geowebcache/mime/MimeType.java

    r248 r403  
    114114        } 
    115115 
    116         log.debug("Unsupported format request: " + formatStr + ", returning null"); 
    117         return null; 
     116        throw new MimeException("Unsupported format request: " + formatStr); 
    118117    } 
    119118