@@ -396,15 +396,17 @@ await Request<DeletePublisherRequest, DeletePublisherResponse>(corr =>
396
396
if ( response . ResponseCode == ResponseCode . Ok )
397
397
return ( subscriptionId , response ) ;
398
398
399
- ClientExceptions . MaybeThrowException ( response . ResponseCode , $ "Error while creating consumer for stream { config . Stream } ") ;
399
+ ClientExceptions . MaybeThrowException ( response . ResponseCode ,
400
+ $ "Error while creating consumer for stream { config . Stream } ") ;
400
401
}
401
402
catch ( Exception e )
402
403
{
403
404
// if the response code is not ok we need to remove the subscription
404
405
// and close the connection if necessary.
405
406
consumers . Remove ( subscriptionId ) ;
406
407
await MaybeClose ( "Create Consumer Exception" , config . Stream , config . Pool ) . ConfigureAwait ( false ) ;
407
- throw new CreateConsumerException ( $ "Error while creating consumer for stream { config . Stream } , error: { e . Message } ") ;
408
+ throw new CreateConsumerException (
409
+ $ "Error while creating consumer for stream { config . Stream } , error: { e . Message } ") ;
408
410
}
409
411
410
412
return ( subscriptionId , new SubscribeResponse ( subscriptionId , ResponseCode . InternalError ) ) ;
@@ -724,7 +726,7 @@ private async ValueTask<bool> SendHeartBeat()
724
726
private void InternalClose ( )
725
727
{
726
728
_heartBeatHandler . Close ( ) ;
727
- // IsClosed = true;
729
+ IsClosed = true ;
728
730
}
729
731
730
732
private bool HasEntities ( )
@@ -747,6 +749,7 @@ public async Task<CloseResponse> Close(string reason)
747
749
return new CloseResponse ( 0 , ResponseCode . Ok ) ;
748
750
}
749
751
752
+ InternalClose ( ) ;
750
753
try
751
754
{
752
755
var result =
@@ -769,8 +772,6 @@ public async Task<CloseResponse> Close(string reason)
769
772
connection . Dispose ( ) ;
770
773
}
771
774
772
- InternalClose ( ) ;
773
-
774
775
return new CloseResponse ( 0 , ResponseCode . Ok ) ;
775
776
}
776
777
0 commit comments