FinderPattern bottomLeft = info.getBottomLeft();
float moduleSize = calculateModuleSize(topLeft, topRight, bottomLeft);
+ if (moduleSize < 1.0f) {
+ throw new ReaderException("Module size too small");
+ }
int dimension = computeDimension(topLeft, topRight, bottomLeft, moduleSize);
Version provisionalVersion = Version.getProvisionalVersionForDimension(dimension);
int modulesBetweenFPCenters = provisionalVersion.getDimensionForVersion() - 7;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
+import java.net.SocketException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.UnknownHostException;
} finally {
is.close();
}
+ } catch (IllegalArgumentException iae) {
+ // Thrown if hostname is bad or null
+ getRequest.abort();
+ response.sendRedirect("badurl.jspx");
+ } catch (SocketException se) {
+ // Thrown if hostname is bad or null
+ getRequest.abort();
+ response.sendRedirect("badurl.jspx");
} catch (HttpException he) {
getRequest.abort();
response.sendRedirect("badurl.jspx");