ScriptEditor why Try Catch is not default option?

The debugging of Python in Grasshopper Script editor often does not show exact line of error.

I most often need to wrap my code around try statement:

        except Exception as e:
            import traceback

I am wondering why this is not default case?
For instance I get an error, it names or does not, and does not tell exact line. It feels there is some sort of try catch statement in ScriptEditor but it is not fully printed for a user…

@Petras_Vestartas The editor should throw the error and mark the line in the editor control. If this is not the case there is a bug. Would you mind sending me an example script that repeats the issue?

1 Like

@eirannejad This is the example. On purpose I try to get object by index, which is way too high. The simpler error pop out, but it does not say where. This kind of error is very hard to debug on larger code. (51.6 KB)

Also curious if on your machine the pypi dependencies both Mac and Windows install properly.

I ran this on both windows and macOS and this is what I am seeing:

What am I missing?

(wood_nano fails to install on my arm64 mac. I see that it only supports x86_64 at the moment)

1 Like


Strange, on my pc there is no line number. I have latest service release. Thank you for checking it.

1 Like

I tested this as well, in dark mode in case it had anything to do with it but I have the same result as Ehsan.


@Petras_Vestartas It might have already been fixed in our builds then :smiley: Good news!

1 Like