@@ -4,6 +4,7 @@ import { IssueIntegrationId } from '../../../constants.integrations';
44import type { Account } from '../../../git/models/author' ;
55import type { IssueOrPullRequest , SearchedIssue } from '../../../git/models/issue' ;
66import { filterMap , flatten } from '../../../system/iterable' ;
7+ import { Logger } from '../../../system/logger' ;
78import type { IntegrationAuthenticationProviderDescriptor } from '../authentication/integrationAuthentication' ;
89import type { ResourceDescriptor } from '../integration' ;
910import { IssueIntegration } from '../integration' ;
@@ -232,15 +233,21 @@ export class JiraIntegration extends IssueIntegration<IssueIntegrationId.Jira> {
232233
233234 const results : SearchedIssue [ ] = [ ] ;
234235 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' ) ;
244251 }
245252 }
246253
0 commit comments