Elfocrash / Cosmonaut

🌐 A supercharged Azure CosmosDB .NET SDK with ORM support
https://cosmonaut.readthedocs.io
MIT License
341 stars 44 forks source link

Exception: There is no way this will ever be thrown. (What all great developers say) #118

Open BenjaBobs opened 5 years ago

BenjaBobs commented 5 years ago

So I recently ran into this: https://github.com/Elfocrash/Cosmonaut/blob/4ecd03a529bc251b8def82726acf4e3360119b89/src/Cosmonaut/Extensions/TaskExtensions.cs#L22

I think it was from doing too many tasks in one go, but there's really no way to be sure without logging the exceptions.

Elfocrash commented 5 years ago

What the? I can't understand how this could happen. Do you have the ApplicationInsights logging enabled?

How can the exception happen but by be null? 😲 Can you reproduce this consistently?

BenjaBobs commented 5 years ago

I did have Application Insights enabled but there is no information other than the exception message. It was a very long running request though, >80k upserts, so I think it was an App Service execution time limitation that caused it, but I'm not sure.

Maybe the try-catch should collect the exception messages and put them into the aggregate exception? 😄

Elfocrash commented 5 years ago

The thing is that you wouldn't see any exception because for this to be caused the Aggregate Exception was null. I am so confused.