diff --git a/src/tap/resource/ASync.java b/src/tap/resource/ASync.java index 5fe3c9cb3c4e9d2a4e6172135c70488a79c483a5..fd0e7cdf5ae4d9ec43369f6104475dbb9349fe39 100644 --- a/src/tap/resource/ASync.java +++ b/src/tap/resource/ASync.java @@ -71,7 +71,7 @@ import uws.service.log.UWSLog.LogLevel; * </ul> * * @author Grégory Mantelet (CDS;ARI) - * @version 2.0 (09/2014) + * @version 2.0 (12/2014) * * @see UWSService */ @@ -181,7 +181,14 @@ public class ASync implements TAPResource { @Override public boolean executeResource(final HttpServletRequest request, final HttpServletResponse response) throws IOException, TAPException{ try{ + + // Ensure the service is currently available: + if (!service.isAvailable()) + throw new TAPException("Can not execute a query: this TAP service is not available! " + service.getAvailability(), UWSException.SERVICE_UNAVAILABLE); + + // Forward the request to the UWS service: return uws.executeRequest(request, response); + }catch(UWSException ue){ throw new TAPException(ue); }