From reporting my exceptions, I saw some weird errors that I think were inside a try() with a LogException() in the catch().
Before investigating in depth I was wondering, are the LogException() for example present in the catch() of the try() reported as real exceptions? In case there is a way to figure out that they are exceptions in a try() like a label telling you this or whatever?
If you manually try-catch it yourself, it is still informative to pass an exception to Debug.LogException just before continuing.
try
{
....
}
catch( Exception e )
{
// Script flow is saved and still can continue from this point
Debug.LogException( e ); // Perhaps will send to cloud service also.
}
Actually went ahead and tried it. I will leave information here for future reader also.
In this experiment I tried both LogException manually and actual uncaught exception.
Note that this is RELEASE build, Mono scripting backend, PC - Windows X64 build.
As expected there will be no line number. Sadly, but had to live with it.
As you seen above, so knowing function name is only your friend here. So it is good practice to keep your function short (<20 lines?), instead of mega big 100+ lines function, just as most clean code practice suggested.
For me, both using Debug.LogException or throwing the exception doesn’t make Cloud Diagnostics to capture the exception, in the build. The only case it captures the exception is throwing it, and in the editor (in play mode).