Describe the bug
When an Exception occurs when starting a projection (becasue it doesnt exist) our code does the following:
if (e.InnerException != null && e.InnerException.Message == "Subscription not found")
{
//Create the Group
await this.EventStoreConnection.CreatePersistentSubscriptionAsync(persistentSubscriptionBuilder.StreamName,
persistentSubscriptionBuilder.GroupName,
persistentSubscriptionBuilder.PersistentSubscriptionSettings,
persistentSubscriptionBuilder.UserCredentials);
await ConnectToPersistentSubscriptionAsync();
}
else
{
throw;
}
The InnerException is null so it never detects the "Subscription not found" message.
We should check the parent exception as well.
To Reproduce
Create a new projection and attempt to create from a console application (i thinkt this is the important part)
Expected behavior
The code should detect the message that the persistent subscription does not exist, and attempt to create it
Describe the bug
When an Exception occurs when starting a projection (becasue it doesnt exist) our code does the following:
The InnerException is null so it never detects the "Subscription not found" message.
We should check the parent exception as well.
To Reproduce
Create a new projection and attempt to create from a console application (i thinkt this is the important part)
Expected behavior
The code should detect the message that the persistent subscription does not exist, and attempt to create it