Commit b2d1fd6f authored by Christopher Combs's avatar Christopher Combs
Browse files

Updated vague FileTool error messages. Fixes #4895

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@7783 41f8697f-d340-4b68-9986-7bafba869bb8
parent 684b85f0
Loading
Loading
Loading
Loading
+33 −26
Original line number Diff line number Diff line
@@ -415,9 +415,12 @@ namespace Isis {
      delete imgEnlarge;
      delete interp;

    } catch(IException &) {
      QMessageBox::critical((QWidget *)parent(),
                            "Error", "Cannot open file, please check permissions");
    } catch(IException &e) {
        // Stacks error message from Cube's create method
        throw IException(e,
            IException::Io,
            QObject::tr("The cube could not be saved, unable to create the cube"),
            _FILEINFO_);
    }
  }

@@ -454,20 +457,14 @@ namespace Isis {
      }
    }

    try {
      ProcessByLine p;
      p.SetInputCube (icube);
      Cube *ocube = NULL;
    try {
      ocube = p.SetOutputCube(psOutFile, CubeAttributeOutput(""), ons, onl, inb);
      // Our processing routine only needs 1
      // the original set was for info about the cube only
      p.ClearInputCubes();
    }
    catch(IException &) {
      // If there is a problem, catch it and close the cube so it isn't open next time around
      icube->close();
      throw;
    }

      Cube *tempcube=new Cube;
      tempcube->open(cubeViewport()->cube()->fileName(), "r");
@@ -481,6 +478,16 @@ namespace Isis {
      delete near;
      near=NULL;
    }
    catch(IException &e) {
      // If there is a problem, catch it and close the cube so it isn't open next time around
      icube->close();
      // Stacks error message from Cube's create method
      throw IException(e,
          IException::Io,
          QObject::tr("The cube could not be saved, unable to create the cube"),
          _FILEINFO_);
    }
  }

  /**
   * AsIs option, save the input image visible in the viewport window Enlarged/Reduced
+4 −2
Original line number Diff line number Diff line
@@ -50,6 +50,8 @@ namespace Isis {
   *                           static QPixmap::grabWidget with QWidget::grab to remove deprecation
   *                           warnings from stdout when using File->Print or File->Export View.
   *                           References #4304.
   *   @history 2017-06-07 Christopher Combs - Changed saveAsEnlargedCube's catch block to stack
   *                           errors and give a more accurate error message.
   */
  class FileTool : public Tool {
      Q_OBJECT