We have a line-item script that we've run one and off for months without issue. Yesterday at around noon, we started seeing 1-4 errors being thrown from the script on almost every order. I duplicated, made some edits (see below for technical details) and published the updated script. The new script is almost identical, but has an added data-type check so that the array method 'join' is not called on inappropriate data-types. SInce the change, we've seen no errors on the new script, but I DO see about 100 more errors on the unpublished script that have occurred since un-publishing. I kept records shwoing that at the time the script was unpublished there were around 230 errors, this morning I see over 300. How is this possible if the script is not published? One of my concerns is that if the error reporting is so inaccurate that I just disregard when errors happen, how will I know if it is serious? The other is that I don't understand how this is possible? I was never able to replicate the error in the debugger, so I am not even 100% confident that my modifications is the reasons that the updated script, now published, is not throwing similar errors.
Here is the error:
Here is the original script:
Here is the updated script- the updarte is on linen 11 and 13:
Here is the original script in the debugger showing "no errors" with the exact same input that originally triggered one of the many many errors: