Code example for PrintWriter

0
 */ 
final class GenericClientExceptionConverter implements ClientExceptionConverter { 
 
    public Object convert(Throwable t) {
        StringWriter s = new StringWriter();
        t.printStackTrace(new PrintWriter(s));
        return new GenericError(s.toString(), 0);
    } 
}