Free cookie consent management tool by TermsFeed Policy Generator

Changeset 14285 for trunk


Ignore:
Timestamp:
09/17/16 18:34:50 (8 years ago)
Author:
gkronber
Message:

#2661: make sure progressbar is removed when the TableFileParser throws an exception

Location:
trunk/sources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/DataAnalysisImportTypeDialog.cs

    r14185 r14285  
    158158      }
    159159      catch (Exception ex) {
    160         if (ex is IOException || ex is InvalidOperationException || ex is ArgumentException || ex is TableFileParser.DataFormatException) {
     160        if (ex is IOException || ex is InvalidOperationException || ex is ArgumentException) {
    161161          OkButton.Enabled = false;
    162162          ErrorTextBox.Text = ex.Message;
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/TableFileParser.cs

    r14185 r14285  
    606606
    607607    private void Error(string message, string token, int lineNumber) {
    608       throw new DataFormatException("Error while parsing.\n" + message, token, lineNumber);
     608      throw new IOException(string.Format("Error while parsing. {0} (token: {1} lineNumber: {2}).", message, token, lineNumber));
    609609    }
    610610    #endregion
    611 
    612     [Serializable]
    613     public class DataFormatException : Exception {
    614       private int line;
    615       public int Line {
    616         get { return line; }
    617       }
    618       private string token;
    619       public string Token {
    620         get { return token; }
    621       }
    622       public DataFormatException(string message, string token, int line)
    623         : base(message + "\nToken: " + token + " (line: " + line + ")") {
    624         this.token = token;
    625         this.line = line;
    626       }
    627 
    628       public DataFormatException(SerializationInfo info, StreamingContext context) : base(info, context) { }
    629     }
    630611  }
    631612}
Note: See TracChangeset for help on using the changeset viewer.