File tree Expand file tree Collapse file tree
FlashpointInstaller/src/Forms
FlashpointManager/src/Forms Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,10 +61,19 @@ private async void Operation_Load(object sender, EventArgs e)
6161 {
6262 stream = new MemoryStream ( await client . DownloadDataTaskAsync ( new Uri ( component . URL ) ) ) ;
6363 }
64- catch ( WebException ex ) when ( ex . Status == WebExceptionStatus . RequestCanceled )
64+ catch ( WebException ex )
6565 {
66- client . Dispose ( ) ;
66+ if ( ex . Status != WebExceptionStatus . RequestCanceled )
67+ {
68+ MessageBox . Show (
69+ $ "The { workingComponent . Title } component failed to download.\n \n " +
70+ "If this issue persists, please let us know as soon as possible." ,
71+ "Error" , MessageBoxButtons . OK , MessageBoxIcon . Error
72+ ) ;
73+ }
74+
6775 cancelStatus = 2 ;
76+ CancelButton . PerformClick ( ) ;
6877 return ;
6978 }
7079 }
@@ -253,7 +262,7 @@ await Task.Run(() =>
253262
254263 private async void CancelButton_Click ( object sender , EventArgs e )
255264 {
256- cancelStatus = 1 ;
265+ if ( cancelStatus < 1 ) cancelStatus = 1 ;
257266
258267 CancelButton . Enabled = false ;
259268 ProgressLabel . Invoke ( ( MethodInvoker ) delegate
Original file line number Diff line number Diff line change @@ -96,10 +96,18 @@ private async void Operation_Load(object sender, EventArgs e)
9696 {
9797 stream = new MemoryStream ( await client . DownloadDataTaskAsync ( new Uri ( component . URL ) ) ) ;
9898 }
99- catch ( WebException ex ) when ( ex . Status == WebExceptionStatus . RequestCanceled )
99+ catch ( WebException ex )
100100 {
101- client . Dispose ( ) ;
101+ if ( ex . Status != WebExceptionStatus . RequestCanceled )
102+ {
103+ FPM . GenericError (
104+ $ "The { workingComponent . Title } component failed to download.\n \n " +
105+ "If this issue persists, please let us know as soon as possible."
106+ ) ;
107+ }
108+
102109 cancelStatus = 2 ;
110+ CancelButton . PerformClick ( ) ;
103111 return ;
104112 }
105113 }
@@ -325,7 +333,7 @@ void MoveDelete(string source, string dest)
325333
326334 private async void CancelButton_Click ( object sender , EventArgs e )
327335 {
328- cancelStatus = 1 ;
336+ if ( cancelStatus < 1 ) cancelStatus = 1 ;
329337
330338 CancelButton . Enabled = false ;
331339 ProgressLabel . Invoke ( ( MethodInvoker ) delegate
You can’t perform that action at this time.
0 commit comments