@@ -4,6 +4,7 @@ import { IssueIntegrationId } from '../../../constants.integrations';
4
4
import type { Account } from '../../../git/models/author' ;
5
5
import type { IssueOrPullRequest , SearchedIssue } from '../../../git/models/issue' ;
6
6
import { filterMap , flatten } from '../../../system/iterable' ;
7
+ import { Logger } from '../../../system/logger' ;
7
8
import type { IntegrationAuthenticationProviderDescriptor } from '../authentication/integrationAuthentication' ;
8
9
import type { ResourceDescriptor } from '../integration' ;
9
10
import { IssueIntegration } from '../integration' ;
@@ -232,15 +233,21 @@ export class JiraIntegration extends IssueIntegration<IssueIntegrationId.Jira> {
232
233
233
234
const results : SearchedIssue [ ] = [ ] ;
234
235
for ( const resource of myResources ) {
235
- const userLogin = ( await this . getProviderAccountForResource ( session , resource ) ) ?. username ;
236
- const resourceIssues = await api . getIssuesForResourceForCurrentUser ( this . id , resource . id , {
237
- accessToken : session . accessToken ,
238
- } ) ;
239
- const formattedIssues = resourceIssues
240
- ?. map ( issue => toSearchedIssue ( issue , this , undefined , userLogin ) )
241
- . filter ( ( result ) : result is SearchedIssue => result != null ) ;
242
- if ( formattedIssues != null ) {
243
- results . push ( ...formattedIssues ) ;
236
+ try {
237
+ const userLogin = ( await this . getProviderAccountForResource ( session , resource ) ) ?. username ;
238
+ const resourceIssues = await api . getIssuesForResourceForCurrentUser ( this . id , resource . id , {
239
+ accessToken : session . accessToken ,
240
+ } ) ;
241
+ const formattedIssues = resourceIssues
242
+ ?. map ( issue => toSearchedIssue ( issue , this , undefined , userLogin ) )
243
+ . filter ( ( result ) : result is SearchedIssue => result != null ) ;
244
+ if ( formattedIssues != null ) {
245
+ results . push ( ...formattedIssues ) ;
246
+ }
247
+ } catch ( ex ) {
248
+ // TODO: We need a better way to message the failure to the user here.
249
+ // This is a stopgap to prevent one bag org from throwing and preventing any issues from being returned.
250
+ Logger . error ( ex , 'searchProviderMyIssues' ) ;
244
251
}
245
252
}
246
253
0 commit comments