use of com.dexels.navajo.script.api.FatalException in project navajo by Dexels.
the class TmlContinuationRunner method abort.
@Override
public void abort(String reason) {
super.abort(reason);
try {
logger.warn("Aborting: {}. Generating outdoc and resuming", reason);
setResponseNavajo(getLocalClient().generateAbortMessage(reason));
} catch (FatalException e) {
logger.error("Error: ", e);
}
continuation.complete();
getRequest().fail(new ServletException(reason));
}
use of com.dexels.navajo.script.api.FatalException in project navajo by Dexels.
the class TmlContinuationRunner method execute.
/**
* Handle a request.
*
* @param request
* @param response
* @throws IOException
* @throws ServletException
*/
private final void execute() throws IOException, ServletException {
startedAt = System.currentTimeMillis();
setCommitted(true);
// BufferedReader r = null;
try {
Navajo in = getInputNavajo();
in.getHeader().setHeaderAttribute("useComet", "true");
boolean continuationFound = false;
try {
int queueSize = getRequestQueue().getQueueSize();
String queueId = getRequestQueue().getId();
ClientInfo clientInfo = getRequest().createClientInfo(scheduledAt, startedAt, queueSize, queueId);
setResponseNavajo(getLocalClient().handleInternal(getNavajoInstance(), in, getRequest().getCert(), clientInfo));
} finally {
if (!continuationFound) {
// resumeContinuation();
// continuation.complete();
endTransaction();
}
}
// }
} catch (Throwable e) {
// e.printStackTrace(System.err);
if (e instanceof FatalException) {
FatalException fe = (FatalException) e;
if (fe.getMessage().equals("500.13")) {
// Server too busy.
continuation.undispatch();
throw new ServletException("500.13");
}
}
throw new ServletException(e);
} finally {
MDC.clear();
}
}
Aggregations