File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
packages/aws-appsync-subscription-link/src Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -755,16 +755,21 @@ export class AppSyncRealTimeSubscriptionHandshakeLink extends ApolloLink {
755755 subscriptionState
756756 } ) ;
757757
758- observer . error ( {
759- errors : [
760- {
761- ...new GraphQLError ( `Connection failed: ${ JSON . stringify ( payload ) } ` )
762- }
763- ]
764- } ) ;
765758 clearTimeout ( startAckTimeoutId ) ;
766759
767- observer . complete ( ) ;
760+ if ( observer ) {
761+ observer . error ( {
762+ errors : [
763+ {
764+ ...new GraphQLError ( `Connection failed: ${ JSON . stringify ( payload ) } ` )
765+ }
766+ ]
767+ } ) ;
768+ observer . complete ( ) ;
769+ } else {
770+ logger ( `observer not found for id: ${ id } ` ) ;
771+ }
772+
768773 if ( typeof subscriptionFailedCallback === "function" ) {
769774 subscriptionFailedCallback ( ) ;
770775 }
You can’t perform that action at this time.
0 commit comments