I’m working on a very large grasshopper project for my architecture masters thesis, and using a lot of custom c# components, many nested lists, and lots of RNG for procedural generation. I keep running into problems in which something in my code goes wrong (all sorts of different causes), and I get:
“error: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index (line: 0)”
Now, I’m well aware of what this means, that something in my code is trying to call an index in one of my lists or arrays that does not exist. However, since the error doesn’t specify which line is causing the invalid index call, it can be INCREDIBLY time consuming to debug. Often just commenting out lines of code until I find the culprit is not enough, as it occurs within a function called from within a particular iteration of a loop. At times I have to spend hours adding in extra print lines and measures to end the module run early in order to find out what is causing it.
So my question is, is there any way I can get more detailed error information, including what line caused the error, and which line the function containing the line causing the error may have been called from? I’ve worked in programs before which have done this, such as Unity 3D, is this kind of more detailed error completely unavailable in Grasshopper, or is there some way to get more detailed error readouts? Any help would be greatly appreciated.