@@ -664,42 +664,47 @@ export class MessageProcessor {
664
664
await this . _updateFragmentDefinition ( uri , contents ) ;
665
665
await this . _updateObjectTypeDefinition ( uri , contents ) ;
666
666
667
- const project = this . _graphQLCache . getProjectForFile ( uri ) ;
668
- if ( project ) {
669
- await this . _updateSchemaIfChanged ( project , uri ) ;
670
- }
667
+ try {
668
+ const project = this . _graphQLCache . getProjectForFile ( uri ) ;
669
+ if ( project ) {
670
+ await this . _updateSchemaIfChanged ( project , uri ) ;
671
+ }
671
672
672
- let diagnostics : Diagnostic [ ] = [ ] ;
673
-
674
- if (
675
- project ?. extensions ?. languageService ?. enableValidation !== false
676
- ) {
677
- diagnostics = (
678
- await Promise . all (
679
- contents . map ( async ( { query, range } ) => {
680
- const results = await this . _languageService . getDiagnostics (
681
- query ,
682
- uri ,
683
- this . _isRelayCompatMode ( query ) ,
684
- ) ;
685
- if ( results && results . length > 0 ) {
686
- return processDiagnosticsMessage ( results , query , range ) ;
687
- }
688
- return [ ] ;
689
- } ) ,
690
- )
691
- ) . reduce ( ( left , right ) => left . concat ( right ) , diagnostics ) ;
692
- }
673
+ let diagnostics : Diagnostic [ ] = [ ] ;
674
+
675
+ if (
676
+ project ?. extensions ?. languageService ?. enableValidation !== false
677
+ ) {
678
+ diagnostics = (
679
+ await Promise . all (
680
+ contents . map ( async ( { query, range } ) => {
681
+ const results = await this . _languageService . getDiagnostics (
682
+ query ,
683
+ uri ,
684
+ this . _isRelayCompatMode ( query ) ,
685
+ ) ;
686
+ if ( results && results . length > 0 ) {
687
+ return processDiagnosticsMessage ( results , query , range ) ;
688
+ }
689
+ return [ ] ;
690
+ } ) ,
691
+ )
692
+ ) . reduce ( ( left , right ) => left . concat ( right ) , diagnostics ) ;
693
+ }
693
694
694
- this . _logger . log (
695
- JSON . stringify ( {
696
- type : 'usage' ,
697
- messageType : 'workspace/didChangeWatchedFiles' ,
698
- projectName : project ?. name ,
699
- fileName : uri ,
700
- } ) ,
701
- ) ;
702
- return { uri, diagnostics } ;
695
+ this . _logger . log (
696
+ JSON . stringify ( {
697
+ type : 'usage' ,
698
+ messageType : 'workspace/didChangeWatchedFiles' ,
699
+ projectName : project ?. name ,
700
+ fileName : uri ,
701
+ } ) ,
702
+ ) ;
703
+ return { uri, diagnostics } ;
704
+ } catch ( err ) {
705
+ this . _handleConfigError ( { err, uri } ) ;
706
+ return { uri, diagnostics : [ ] } ;
707
+ }
703
708
}
704
709
if ( change . type === FileChangeTypeKind . Deleted ) {
705
710
await this . _graphQLCache . updateFragmentDefinitionCache (
0 commit comments