• Many thanks. Plenty of ideas to try there. I'll implement what you suggest and report back what happens when it fails again.

  • Just spotted this:

    Fr L#60 function setCurrentUsage() {

    Here is a likely spot. There are two division equations. If the divisor is ever zero, a divide by zero error will be thrown. Place the try/catch just inside this function wrapping all, or create two separate to isolate. Maybe a system call to time is not completing timely.

    Is L68 an acceptable practice? (combining a float with string text 'e' to return a number inside round?) parseFloat() or parseInt() are required to provide the Math object with a valid number.
    or

    https://www.w3schools.com/jsref/jsref_to­exponential.asp

    https://developer.mozilla.org/en-US/docs­/Web/JavaScript/Reference/Global_Objects­/Math
    "Math is a built-in object that works with the Number type"



    Could the const keyword be blocking a later assignment to that corresponding declaration.
    Try changing all const to var to test. Not likely, but worth a shot.

    Add a clearWatch() in every catch to immediately stop execution. Label each with a useful descriptor like a line number. Hopefully there will be enough previous console.log detail prior to the clearWatch() call to review.

    Run time debugging is a challenge and can be a real pain, . . . just waiting.

  • Good catch with the division. I've now added the try/catch to see if the issue is with that.

    Regarding L68, I'm not sure it is acceptable practice, but it was a trick I found to round a number to x decimal places. If that is the issue, then the try/catch should catch that, although I've been using the same snippet in other work, so I'd be surprised if that is the issue.

    Thanks for the tips, I've updated the Puck code so I'll wait and see what gets logged out.

About

Avatar for Robin @Robin started