70 |
@Override |
@Override |
71 |
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { |
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { |
72 |
if (req.getParameter("station") == null) { |
if (req.getParameter("station") == null) { |
73 |
resp.sendError(400, "not enough parameters"); |
resp.sendError(400, "not enough parameters (station)"); |
74 |
return; |
return; |
75 |
} |
} |
76 |
|
if (req.getParameter("format") == null) { |
77 |
|
resp.sendError(400, "not enough parameters (format)"); |
78 |
|
return; |
79 |
|
} |
80 |
|
|
81 |
boolean arrival = false; |
boolean arrival = false; |
82 |
try { |
try { |
99 |
resp.sendError(500); |
resp.sendError(500); |
100 |
return; |
return; |
101 |
} catch (CircuitBreakerException cbe) { |
} catch (CircuitBreakerException cbe) { |
102 |
logger.warning("Circuitbreaker - failing fast"); |
logger.warning("Circuitbreaker - failing fast, station=" +station); |
103 |
Statistics.getInstance().incrementDepartureErrors(); |
Statistics.getInstance().incrementDepartureErrors(); |
104 |
resp.sendError(500); |
resp.sendError(500); |
105 |
return; |
return; |