@@ -161,7 +161,7 @@ internal async Task InstallOrUpdateAsync(UserPlugin plugin)
161
161
162
162
if ( canReportProgress &&
163
163
( prgBox = Context . API . ShowProgressBox ( $ "Download { plugin . Name } ...", ( ) =>
164
- {
164
+ {
165
165
httpClient . CancelPendingRequests ( ) ;
166
166
downloadCancelled = true ;
167
167
prgBox = null ;
@@ -209,15 +209,11 @@ internal async Task InstallOrUpdateAsync(UserPlugin plugin)
209
209
else
210
210
{
211
211
filePath = plugin . LocalInstallPath ;
212
- Install ( plugin , filePath ) ;
213
- }
212
+ Install ( plugin , filePath ) ;
213
+ }
214
214
}
215
215
catch ( HttpRequestException e )
216
216
{
217
- Context . API . ShowMsgError (
218
- string . Format ( Context . API . GetTranslation ( "plugin_pluginsmanager_downloading_plugin" ) , plugin . Name ) ,
219
- Context . API . GetTranslation ( "plugin_pluginsmanager_download_error" ) ) ;
220
- Log . Exception ( "PluginsManager" , "An error occurred while downloading plugin" , e ) ;
221
217
// force close progress box
222
218
Application . Current . Dispatcher . Invoke ( ( ) =>
223
219
{
@@ -227,14 +223,17 @@ internal async Task InstallOrUpdateAsync(UserPlugin plugin)
227
223
prgBox = null ;
228
224
}
229
225
} ) ;
226
+
227
+ // show error message
228
+ Context . API . ShowMsgError (
229
+ string . Format ( Context . API . GetTranslation ( "plugin_pluginsmanager_downloading_plugin" ) , plugin . Name ) ,
230
+ Context . API . GetTranslation ( "plugin_pluginsmanager_download_error" ) ) ;
231
+ Log . Exception ( "PluginsManager" , "An error occurred while downloading plugin" , e ) ;
232
+
230
233
return ;
231
234
}
232
235
catch ( Exception e )
233
236
{
234
- Context . API . ShowMsgError ( Context . API . GetTranslation ( "plugin_pluginsmanager_install_error_title" ) ,
235
- string . Format ( Context . API . GetTranslation ( "plugin_pluginsmanager_install_error_subtitle" ) ,
236
- plugin . Name ) ) ;
237
- Log . Exception ( "PluginsManager" , "An error occurred while downloading plugin" , e ) ;
238
237
// force close progress box
239
238
Application . Current . Dispatcher . Invoke ( ( ) =>
240
239
{
@@ -244,6 +243,13 @@ internal async Task InstallOrUpdateAsync(UserPlugin plugin)
244
243
prgBox = null ;
245
244
}
246
245
} ) ;
246
+
247
+ // show error message
248
+ Context . API . ShowMsgError ( Context . API . GetTranslation ( "plugin_pluginsmanager_install_error_title" ) ,
249
+ string . Format ( Context . API . GetTranslation ( "plugin_pluginsmanager_install_error_subtitle" ) ,
250
+ plugin . Name ) ) ;
251
+ Log . Exception ( "PluginsManager" , "An error occurred while downloading plugin" , e ) ;
252
+
247
253
return ;
248
254
}
249
255
0 commit comments