42 |
|
|
43 |
@Override |
@Override |
44 |
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { |
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { |
45 |
|
if (req.getParameter("station") == null) { |
46 |
|
resp.sendError(400, "not enough parameters"); |
47 |
|
return; |
48 |
|
} |
49 |
|
|
50 |
int station = Integer.parseInt( req.getParameter("station") ); |
int station = Integer.parseInt( req.getParameter("station") ); |
51 |
String format = req.getParameter("format"); |
String format = req.getParameter("format"); |
52 |
|
|
56 |
|
|
57 |
try { |
try { |
58 |
beans = fetcher.cachedLookupDepartures(station); |
beans = fetcher.cachedLookupDepartures(station); |
59 |
} catch (java.net.SocketTimeoutException ste) { |
} catch (java.io.IOException ioe) { |
60 |
logger.warning("Read timed out, station="+station); |
logger.warning("Read failed, station="+station + ". " + ioe.getMessage() ); |
61 |
resp.sendError(500); |
resp.sendError(500); |
62 |
return; |
return; |
63 |
} catch (CircuitBreakerException cbe) { |
} catch (CircuitBreakerException cbe) { |