@jmacdonald I will typically add log messages to key points in the script, i.e. as the first thing every function does. That helps me trace which function is causing the error. Once I've narrowed that down, I'll add more detailed logging at various points in that function to narrow down which line is causing the problem. It's a bit tedious, especially if your script is not easily testable, but it shouldn't take too many attempts to narrow things down that way.