Advanced

Debugging scripts?

Debugging scripts?
November 20, 2024 05:41PM
I've now experimented with writing some scripts from the scratch, but I was wondering - what are the means for debugging in case script runs into error? I know PGC.print works in many times, but what options do I have when the script execution ends into "unknown error" printing no output at all?

In case this is mentioned in some FAQs, kindly point me to right direction as I've obviously not stumbled upon it..

Unknown error
Execution time (s)
Peak memory usage (kB)
Error message
Execution status
Re: Debugging scripts?
November 20, 2024 06:29PM
Usually when you get an unknown error when immediately running a script, it's because the profile name you ran is incorrect. If that's not the case, and you get some sort of other error, you can look at the log for ID it gives you when it runs, which will contain your log statements. I find usually this log is more useful than the "Show debug output", because that doesn't usually update properly if the script encounters an exception.

When you run a script, it gives you a ID for the log text.
"Using token: <ID - a long alphanumeric>"

Goto:
https://project-gc.com/Tools/Challenges?viewDebugLog=<ID>;
Re: Debugging scripts?
November 20, 2024 07:21PM
Perfect! Great hint - thanks. Found the culprit - outdated country name in parameter list which apparently no longer exists in PGC.
Sorry, you do not have permission to post/reply in this forum.