<commit_before>/*
 * $Id$
 *
 * Copyright (c) 2008 by <NAME>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License (LGPL) as published by the Free Software Foundation.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, copies are available
 * at http://www.opensource.org.
 */

package VASSAL.tools.imageop;

import java.io.IOException;
import java.util.concurrent.ExecutionException;

import VASSAL.build.BadDataReport;
import VASSAL.i18n.Resources;
import VASSAL.tools.ErrorDialog;
import VASSAL.tools.ErrorUtils;

/**
 * @author <NAME>
 * @since 3.1.0
 */
public class OpErrorDialog {
  private OpErrorDialog() {}

  public static void error(ExecutionException e, ImageOp op) {
    // unpack the exception
    final IOException ioe = ErrorUtils.getAncestorOfClass(IOException.class, e);
    if (ioe != null) {
/*
      for (ImageOp src = op; src != null; src = src.getSource()) {
        if (src instanceof SourceOp) {
          // Failed to find this image in the module
          ErrorDialog.dataError(new BadDataReport("Image not found",((SourceOp) src).getName(),ioe));
          return;
        }
      }
*/
      // otherwise we had some other kind of I/O problem
      ErrorDialog.error(
        Resources.getString("Error.io_error"),
        Resources.getString("Error.io_error"),
        e,
        Resources.getString("Error.io_error_message"),
        ioe.getMessage()
      );

      return;<commit_msg>Added FIXME. This is completely broken right now.<commit_after>/*
 * $Id$
 *
 * Copyright (c) 2008 by <NAME>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License (LGPL) as published by the Free Software Foundation.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, copies are available
 * at http://www.opensource.org.
 */

package VASSAL.tools.imageop;

import java.io.IOException;
import java.util.concurrent.ExecutionException;

import VASSAL.build.BadDataReport;
import VASSAL.i18n.Resources;
import VASSAL.tools.ErrorDialog;
import VASSAL.tools.ErrorUtils;

/**
 * @author <NAME>
 * @since 3.1.0
 */
public class OpErrorDialog {
  private OpErrorDialog() {}

  public static void error(ExecutionException e, ImageOp op) {
    // unpack the exception
    final IOException ioe = ErrorUtils.getAncestorOfClass(IOException.class, e);
    if (ioe != null) {
// FIXME!
/*
      for (ImageOp src = op; src != null; src = src.getSource()) {
        if (src instanceof SourceOp) {
          // Failed to find this image in the module
          ErrorDialog.dataError(new BadDataReport("Image not found",((SourceOp) src).getName(),ioe));
          return;
        }
      }
*/
      // otherwise we had some other kind of I/O problem
      ErrorDialog.error(
        Resources.getString("Error.io_error"),
        Resources.getString("Error.io_error"),
        e,
        Resources.getString("Error.io_error_message"),
        ioe.getMessage()
      );

      return;
{'fraction_non_alphanumeric': 0.09751485683414371, 'fraction_numerical': 0.004862236628849271, 'mean_word_length': 3.151345291479821, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4729328', 'n_tokens_mistral': 1039, 'n_tokens_neox': 1021, 'n_words': 373}