Early exits in javascript generators

I was debugging a generator exiting early, seemingly without passing any of my final logging statements: async function * getNextSponsoredCarouselProduct( logger : ILogger | undefined , requestBids : RequestBidsFn , generateProductCardResponse : GenerateSponsoredProductCardResponseFn , request : IBidRequest ) : AsyncGenerator < IBuiltProductCardBidResponse > { const log = Ctx(logger) ? . with (…