private void errorsToJson(Errors errors,PrintWriter writer){
  final StringBuilder result=new StringBuilder();
  errorsToJson(errors,result);
  writer.print(result.toString());
}

private void errorsToJson ( Errors errors , PrintWriter writer ) { final StringBuilder result = new StringBuilder ( ) ; errorsToJson ( errors , result ) ; writer . print ( result . toString ( ) ) ; }
helper method . converts ` errors ` to json .
