HeaderPrintWriter errorStream = Monitor.getStream();
if (errorStream == null) {
t.printStackTrace();
return;
}
ErrorStringBuilder errorStringBuilder = new ErrorStringBuilder(errorStream.getHeader());
errorStringBuilder.append( errorMessage );
errorStringBuilder.stackTrace( t );
errorStream.print(errorStringBuilder.get().toString());
errorStream.flush();
errorStringBuilder.reset();
}