Changeset 13060 for trunk/sources


Ignore:
Timestamp:
10/23/15 11:53:17 (4 years ago)
Author:
ascheibe
Message:

#2496 improved information shown in error dialog

Location:
trunk/sources
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveJobManagerView.cs

    r12012 r13060  
    107107      } else {
    108108        if (ex is MessageSecurityException) {
    109           MessageBox.Show("A Message Security error has occured. This normally means that your user name or password is wrong.", "HeuristicLab Hive Job Manager", MessageBoxButtons.OK, MessageBoxIcon.Error);
     109          string message =
     110            "A Message Security error has occured. This normally means that your user name or password is wrong. Detailed information: " + Environment.NewLine;
     111          message += HiveServiceLocator.Instance.GetEndpointInformation();
     112          ErrorHandling.ShowErrorDialog(this, message, ex);
    110113        } else if (ex is AnonymousUserException) {
    111114          using (HiveInformationDialog dialog = new HiveInformationDialog()) {
     
    113116          }
    114117        } else {
    115           ErrorHandling.ShowErrorDialog(this, "Refresh failed.", ex);
     118          ErrorHandling.ShowErrorDialog(this,
     119            "Refresh failed. Detailed information: " + Environment.NewLine + HiveServiceLocator.Instance.GetEndpointInformation(), ex);
    116120        }
    117121      }
  • trunk/sources/HeuristicLab.Clients.Hive/3.3/HiveServiceLocator.cs

    r12012 r13060  
    3636    }
    3737
    38     private HiveServiceLocator() {
    39     }
     38    private HiveServiceLocator() { }
    4039
    4140    private string username;
     
    5453
    5554    public string WorkingEndpoint { get; private set; }
     55
     56
     57    public string GetEndpointInformation() {
     58      string message = "Configured endpoints: " + Environment.NewLine;
     59
     60      var configurations = Settings.Default.EndpointConfigurationPriorities;
     61      foreach (var endpointConfigurationName in configurations) {
     62        var cl = ClientFactory.CreateClient<HiveServiceClient, IHiveService>(endpointConfigurationName);
     63        message += endpointConfigurationName + ": " + cl.Endpoint.Address + Environment.NewLine;
     64      }
     65
     66      if (string.IsNullOrEmpty(WorkingEndpoint)) {
     67        message += "No working endpoint found, check you configuration.";
     68      } else {
     69        message += "Used endpoint: " + WorkingEndpoint;
     70      }
     71
     72      return message;
     73    }
    5674
    5775    private HiveServiceClient NewServiceClient() {
  • trunk/sources/HeuristicLab.Clients.Hive/3.3/IHiveServiceLocator.cs

    r12012 r13060  
    2828    void CallHiveService(Action<IHiveService> call);
    2929    T CallHiveService<T>(Func<IHiveService, T> call);
     30
     31    string GetEndpointInformation();
    3032  }
    3133}
Note: See TracChangeset for help on using the changeset viewer.