// has already been failed or we wrote everything already.
}
}
<<<<<<< HEAD
=======
// If the request ever failed, write an error message.
// FIXME: This should probably check if it's a GET and send a 404.
if(isFailed()) {
httpResponse.setContentType("text/html");
Writer writer = new BufferedWriter(new OutputStreamWriter(os));
// Write the error response.
try {
writer.write(getFailureMessage());
}
catch(IOException e) {
LOGGER.warn("Unable to write failed response message. Aborting.", e);
}
// Flush it.
try {
writer.flush();
}
catch(IOException e) {
LOGGER.warn("Unable to flush the writer.", e);
}
// Close it.
try {
writer.close();
}
catch(IOException e) {
LOGGER.warn("Unable to close the writer.", e);
}
}
>>>>>>> 1af64896d9aadb15d1e2c99dd46982c827b49f37
}
} |