public void sendError(int errorCode, String msg) throws IllegalStateException {
try {
String id = "";
IHttpConnection connection = getConnection();
if (connection != null) {
id = connection.getId();
}
send(new HttpResponse(errorCode, "text/html", HttpClientConnection.generateErrorMessageHtml(errorCode, msg, id)));
} catch (IOException ioe) {
if (LOG.isLoggable(Level.FINE)) {
LOG.fine("could not send error message " + errorCode + " reason " + ioe.toString());