Try to debug this with pretty-printing enabled. Click the source reference in the console, for the log() output and the exception. Does the debugger take you to the correct line in the script?