src/main/java/net/socialgamer/cah/servlets/CahServlet.java
/**
   * Return an error to the client.
   *
   * @param writer Response writer to send the error data to.
   * @param code   Error code to return to client.
   * @param serial Request serial number from client.
   */
Return an error to the client.
@param writer Response writer to send the error data to.
@param code   Error code to return to client.
@param serial Request serial number from client.
Return an error to the client . @param writer Response writer to send the error data to . @param code Error code to return to client . @param serial Request serial number from client .
protected void returnError(final PrintWriter writer, final ErrorCode code, final int serial) {
    final JSONObject ret = new JSONObject();
    ret.put(AjaxResponse.ERROR.toString(), Boolean.TRUE);
    ret.put(AjaxResponse.ERROR_CODE.toString(), code.toString());
    ret.put(AjaxResponse.SERIAL.toString(), serial);
    writer.println(ret.toString());
  }
protected void returnError ( final PrintWriter writer , final ErrorCode code , final int serial ) { final JSONObject ret = new JSONObject ( ) ; ret . put ( AjaxResponse . ERROR . toString ( ) , Boolean . TRUE ) ; ret . put ( AjaxResponse . ERROR_CODE . toString ( ) , code . toString ( ) ) ; ret . put ( AjaxResponse . SERIAL . toString ( ) , serial ) ; writer . println ( ret . toString ( ) ) ; }
Return an error to the client.
Return an error to the client .