Commit 44e80101 authored by Christopher Combs's avatar Christopher Combs
Browse files

Changed Cube's creation error message to be more descriptive. Fixes #833.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@7756 41f8697f-d340-4b68-9986-7bafba869bb8
parent 80c24988
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -446,19 +446,22 @@ namespace Isis {
    }

    if (!m_labelFile->open(QIODevice::Truncate | QIODevice::ReadWrite)) {
      QString msg = "Failed to create [" + m_labelFile->fileName() + "]";
      QString msg = "Failed to create [" + m_labelFile->fileName() + "]. ";
      msg += "Verify the output path exists and you have permission to write to the path.";
      cleanUp(false);
      throw IException(IException::Io, msg, _FILEINFO_);
    }

    if (m_dataFile) {
      if (m_storesDnData && !m_dataFile->open(QIODevice::Truncate | QIODevice::ReadWrite)) {
        QString msg = "Failed to create [" + m_dataFile->fileName() + "]";
        QString msg = "Failed to create [" + m_dataFile->fileName() + "]. ";
        msg += "Verify the output path exists and you have permission to write to the path.";
        cleanUp(false);
        throw IException(IException::Io, msg, _FILEINFO_);
      }
      else if (!m_storesDnData && !m_dataFile->open(QIODevice::ReadOnly)) {
        QString msg = "Failed to open [" + m_dataFile->fileName() + "] for reading";
        QString msg = "Failed to open [" + m_dataFile->fileName() + "] for reading. ";
        msg += "Verify the output path exists and you have permission to read from the path.";
        cleanUp(false);
        throw IException(IException::Io, msg, _FILEINFO_);
      }
+3 −2
Original line number Diff line number Diff line
@@ -154,6 +154,8 @@ namespace Isis {
   *                           historgram function. Also commented out a call to
   *                           Histogram::SetBinRange() because this function no longer
   *                           exists in Histogram.  See Ref. #2188.
   *   @history 2017-06-08 Chris Combs - Made "Failed to create" error messages more descriptive.
   *                           Fixes #833.
   */
  class Cube {
    public:
@@ -422,4 +424,3 @@ namespace Isis {
Q_DECLARE_METATYPE(Isis::Cube *);

#endif