Can anyone please point me in the right direction as to how I can go about catching an error in a system. At one of my clients, every now and again a script doesn't work properly and I can't for the life me figure out where the issue is coming from. I had the issue again this morning where a credit note didn't post properly so I took the backup before and after the event and every time when I run it on my machine it runs as expected.
The main issue is it happens so infrequently I can't seem to catch the error. Obviously all the error checking I am continuing to add to the script doesn't seem to be helping and I am pulling out what little hair I have left trying to figure out where the system is falling over.
Would maybe running the script with PSoS be a solution?