24 |
import org.w3c.dom.Document; |
import org.w3c.dom.Document; |
25 |
import org.w3c.dom.Element; |
import org.w3c.dom.Element; |
26 |
|
|
27 |
|
import dk.thoerup.curcuitbreaker.CircuitBreakerException; |
28 |
import dk.thoerup.traininfoservice.DBConnection; |
import dk.thoerup.traininfoservice.DBConnection; |
29 |
|
|
30 |
/** |
/** |
49 |
String stationName = getStationName(station); |
String stationName = getStationName(station); |
50 |
|
|
51 |
try { |
try { |
52 |
beans = fetcher.lookupDepartures(station); |
beans = fetcher.cachedLookupDepartures(station); |
53 |
} catch (java.net.SocketTimeoutException ste) { |
} catch (java.net.SocketTimeoutException ste) { |
54 |
logger.warning("Read timed out, station="+station); |
logger.warning("Read timed out, station="+station); |
55 |
resp.sendError(500); |
resp.sendError(500); |
56 |
return; |
return; |
57 |
} catch (Exception e) { |
} catch (CircuitBreakerException cbe) { |
58 |
|
logger.warning("Circuitbreaker - failing fast"); |
59 |
|
resp.sendError(500); |
60 |
|
return; |
61 |
|
} catch (Throwable e) { |
62 |
logger.log(Level.WARNING, "Unknown exception, station=" +station, e); |
logger.log(Level.WARNING, "Unknown exception, station=" +station, e); |
63 |
resp.sendError(500); |
resp.sendError(500); |
64 |
return; |
return; |