private static Response failure(final Throwable err,final int code) throws IOException {
  final ByteArrayOutputStream baos=new ByteArrayOutputStream();
  final PrintStream stream=new Utf8PrintStream(baos,false);
  try {
    err.printStackTrace(stream);
  }
  finally {
    stream.close();
  }
  return new RsWithStatus(new RsText(new ByteArrayInputStream(baos.toByteArray())),code);
}

private static Response failure ( final Throwable err , final int code ) throws IOException { final ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; final PrintStream stream = new Utf8PrintStream ( baos , false ) ; try { err . printStackTrace ( stream ) ; } finally { stream . close ( ) ; } return new RsWithStatus ( new RsText ( new ByteArrayInputStream ( baos . toByteArray ( ) ) ) , code ) ; }
make a failure response .
