Grasshopper

algorithmic modeling for Rhino

No line numbers when catching ArgumentOutOfRange exceptions

Hi David,

When using C# blocks, this kind of (common) mistakes

List < int> numbers = new List<int >();
A = numbers[2];

will throw an System.ArgumentOutOfRangeExceptions and in grasshopper will allways throw this error:

error: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index (line: 0)

The main thing is that the line number will always return line number 0; which is not so helpful in debugging the problem. I've found that catching the error and giving back the stacktrace will allow you to debug it, but is it possible to also by default correctly parse the line number in using C# blocks? (e.g. IndexOutOfRangeExceptions will be parsed fine)

Thanks

Views: 188

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service