--- android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/DepartureServlet.java 2009/10/20 10:32:19 451 +++ android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/DepartureServlet.java 2009/10/22 06:04:45 468 @@ -24,7 +24,7 @@ import org.w3c.dom.Document; import org.w3c.dom.Element; -import dk.thoerup.curcuitbreaker.CircuitBreakerException; +import dk.thoerup.circuitbreaker.CircuitBreakerException; import dk.thoerup.traininfoservice.DBConnection; /** @@ -42,6 +42,11 @@ @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + if (req.getParameter("station") == null) { + resp.sendError(400, "not enough parameters"); + return; + } + int station = Integer.parseInt( req.getParameter("station") ); String format = req.getParameter("format"); @@ -51,8 +56,8 @@ try { beans = fetcher.cachedLookupDepartures(station); - } catch (java.net.SocketTimeoutException ste) { - logger.warning("Read timed out, station="+station); + } catch (java.io.IOException ioe) { + logger.warning("Read failed, station="+station + ". " + ioe.getMessage() ); resp.sendError(500); return; } catch (CircuitBreakerException cbe) {