@@ -254,9 +254,13 @@ private async Task LoadDataAsync()
254
254
255
255
tvCurrentBranch . ItemsSource = runsList ;
256
256
}
257
+ catch ( ApiException ex )
258
+ {
259
+ await _pane . WriteLineAsync ( $ "Error retrieving Workflow Runs: { ex . Message } :{ ex . StatusCode } ") ;
260
+ await ex . LogAsync ( ) ;
261
+ }
257
262
catch ( Exception ex )
258
263
{
259
- Console . WriteLine ( ex ) ;
260
264
await ex . LogAsync ( ) ;
261
265
}
262
266
@@ -292,6 +296,14 @@ private async Task RefreshEnvironmentsAsync(GitHubClient client)
292
296
envList . Add ( new ( ) { Name = resx . NO_ENV } ) ;
293
297
}
294
298
}
299
+ catch ( ApiException ex )
300
+ {
301
+ if ( ex . StatusCode == System . Net . HttpStatusCode . Unauthorized || ex . StatusCode == System . Net . HttpStatusCode . Forbidden )
302
+ {
303
+ envList . Add ( new SimpleEnvironment ( ) { Name = "Insufficient permissions to retrieve Secrets" } ) ;
304
+ await ex . LogAsync ( ex . Message ) ;
305
+ }
306
+ }
295
307
catch ( Exception ex )
296
308
{
297
309
envList . Add ( new SimpleEnvironment ( ) { Name = "Unable to retrieve Environments, please check logs" } ) ;
@@ -309,6 +321,11 @@ private async Task RefreshWorkflowsAsync(GitHubClient client)
309
321
var workflows = await client . Actions ? . Workflows ? . List ( _repoInfo . RepoOwner , _repoInfo . RepoName ) ;
310
322
tvWorkflows . ItemsSource = workflows . Workflows ;
311
323
}
324
+ catch ( ApiException ex )
325
+ {
326
+ await _pane . WriteLineAsync ( $ "Error retrieving Workflows: { ex . Message } :{ ex . StatusCode } ") ;
327
+ await ex . LogAsync ( ) ;
328
+ }
312
329
catch ( Exception ex )
313
330
{
314
331
await ex . LogAsync ( ) ;
@@ -339,8 +356,18 @@ private async Task RefreshSecretsAsync(GitHubClient client)
339
356
secretList . Add ( resx . NO_REPO_SECRETS ) ;
340
357
}
341
358
}
359
+ catch ( ApiException ex )
360
+ {
361
+ if ( ex . StatusCode == System . Net . HttpStatusCode . Unauthorized || ex . StatusCode == System . Net . HttpStatusCode . Forbidden )
362
+ {
363
+ await _pane . WriteLineAsync ( $ "Error retrieving Secrets: { ex . Message } :{ ex . StatusCode } ") ;
364
+ secretList . Add ( "Insufficient permissions to retrieve Secrets" ) ;
365
+ await ex . LogAsync ( ex . Message ) ;
366
+ }
367
+ }
342
368
catch ( Exception ex )
343
369
{
370
+ // check to see if a permission thing
344
371
secretList . Add ( "Unable to retrieve Secrets, please check logs" ) ;
345
372
await ex . LogAsync ( ) ;
346
373
}
0 commit comments