JetBrains / TeamCity.ServiceMessages

.NET library to deal with TeamCity Service messages
http://confluence.jetbrains.net/display/TCDL/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-ServiceMessages
Apache License 2.0
45 stars 13 forks source link

Make exception messages more descriptive for cases when test suites or flows are incorrectly disposed #35

Closed boris-yakhno closed 11 months ago

boris-yakhno commented 12 months ago

The problem

When TeamCityTestSuiteBlock or TeamCityFlowWriter instances are disposed, a check is made if no child suites/tests/flows are open. If there are open children, an exception is thrown. The exception message is not very descriptive, e.g.:

Some child test suite writers were not disposed.
System.InvalidOperationException
   at JetBrains.TeamCity.ServiceMessages.Write.Special.Impl.Writer.TeamCityTestSuiteBlock.DisposeImpl()
   at JetBrains.TeamCity.ServiceMessages.Write.Special.Impl.Writer.BaseDisposableWriter`1.Dispose()
   at JetBrains.TeamCity.ServiceMessages.Write.Special.Impl.TeamCityWriterImpl.Dispose()
...

which is not very useful to diagnose the problem.

The proposal

The proposal is to add open suite / test / flow names to the exception message.