code: public static UnitResponse createError(String errCode, Object data, String errMsg) {
          if (Group.CODE_SUCCESS.equalsIgnoreCase(errCode)) {
              throw new IllegalArgumentException("Only non-success code is allowed here.");
          }
          return new UnitResponse().setCode(errCode).setData(data).setMessage(errMsg);
      }
docs: create a new error unit response instance.
  
  @param errCode the error code.
  @param data    the data, anything you want, can be an exception object too
  @param errMsg  the error message.
  @return the newly created unit response object.