浏览代码

Add login failed message for server connect timeouts.

Brett Credo 8 年之前
父节点
当前提交
87fe0f97f3
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      BulkPrinting/BulkPrinting/Utility.cs

+ 5 - 1
BulkPrinting/BulkPrinting/Utility.cs

100
             }
100
             }
101
             catch (WebException ex)
101
             catch (WebException ex)
102
             {
102
             {
103
-                if (ex != null && ex.Response != null)
103
+                if (ex.Response != null)
104
                 {
104
                 {
105
                     var response = ex.Response;
105
                     var response = ex.Response;
106
                     var stream = response.GetResponseStream();
106
                     var stream = response.GetResponseStream();
116
                         MessageBox.Show("Login Failed. Please try again.", "Login Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
116
                         MessageBox.Show("Login Failed. Please try again.", "Login Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
117
                     }
117
                     }
118
                 }
118
                 }
119
+                else
120
+                {
121
+                    MessageBox.Show("The server did not return a response to the login request. Please try again later.", "Login Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
122
+                }
119
                 return false;
123
                 return false;
120
             }
124
             }
121
         }
125
         }