コード例 #1
0
  @Override
  public void showError(String message, @Nullable FormField group) {
    if (Strings.isNullOrEmpty(message)) return;

    String msg = message;
    try {
      ClientErrorDto errorDto = JsonUtils.unsafeEval(message);
      msg = errorDto.getStatus();
    } catch (Exception ignored) {
    }
    if (group == null) {
      dialog.addAlert(msg, AlertType.ERROR);
    } else {
      dialog.addAlert(msg, AlertType.ERROR, variableGroup);
    }
  }
コード例 #2
0
 @Override
 public void showError(
     @Nullable IndexConfigurationPresenter.Display.FormField formField, String message) {
   ControlGroup group = null;
   if (formField != null) {
     switch (formField) {
       case CLUSTER_NAME:
         group = clusterGroup;
         break;
       case SHARDS:
         group = shardsGroup;
         break;
       case REPLICAS:
         group = replicasGroup;
         break;
     }
   }
   if (group == null) {
     dialog.addAlert(message, AlertType.ERROR);
   } else {
     dialog.addAlert(message, AlertType.ERROR, group);
   }
 }
コード例 #3
0
 @Override
 public void showError(@Nullable FormField formField, String message) {
   modal.addAlert(message, AlertType.ERROR);
 }