KSP-KOS/KOS — pull request #323 by Dunbaratu (2014-11-04 10:15:36+00:00)
Title: bugs in logging an exception caused a new exception that masked the original.

When a C# System exception is thrown due to a bug in our own C# code rather than something occurring in the kerboscript's code, the KSPlogger doesn't have a source filepath to work with (this is the path to the kerboscript where the error happened), and it didn't deal properly with the condition where that path is null.

This was masking part of the stack trace of the original C# exception in the output_log, because the trace ended up describing the new exception thrown by the KSPLogger itself instead of the original exception.

This was fixed by moving the use of the source filepath string to AFTER the check to see if it's null has occurred (previously the checks didn't happen until after the first attempt to make use of the string, making the checks rather pointless).

I had to do this to diagnose what was wrong with the develop platform, as described in issue TODO