Random fatal error without callstack



  • Hi all,
    i'm using neonious-one to constantly read an analog value from a water-pressure sensor to monitor my water tank level.

    At random i found the board blocked, and after login the popup says:

    An fatal error has occured in the program: TypeError: undefined not callable Program cannot continue.
    

    The main problem is that i don't know what cause the problem since into callstack tab i have:

    Paused outside program code, while waiting for events
    

    What i can do to undestand the root cause of the problem?



  • Somewhere your program (or low.js) is throwing and that is not being catched.

    Catch the error with process uncaughtException event (https://nodejs.org/api/process.html#process_event_uncaughtexception) and output the error's stack for more information where it is happening.



  • Thank you for the suggestion, i will add this exception handler to catch those errors.



  • Finally, I have some time to spend again on the project and as suggested I have added the following lines of code:

    require('process').on('uncaughtException', function uncaughtExceptionListener (err, origin) {
        console.error(
            `Caught exception: ${err}\n` +
            `Exception origin: ${origin}`
        );
        if (err.hasOwnProperty("Tracedata")) {
            console.error(err.Tracedata.toString());
        }
        console.trace("uncaughtException Trace");
    });
    

    But always I found something like this:

    [8:15:56 AM] Caught exception: TypeError: object required, found undefined (stack index -1)
    [8:15:56 AM] Exception origin: undefined
    [8:15:56 AM] Error: uncaughtException Trace
    [8:15:56 AM]     at uncaughtExceptionListener (/index.js:36)
    [8:15:56 AM]     at emit (lib:events:158)
    [3:08:29 AM] Caught exception: TypeError: undefined not callable
    [3:08:29 AM] Exception origin: undefined
    [3:08:29 AM] Error: uncaughtException Trace
    [3:08:29 AM]     at uncaughtExceptionListener (/index.js:36)
    [3:08:29 AM]     at emit (lib:events:158)
    

    Any way to obtain more useful information?



  • Hi !

    Can you reproduce this with low.js on the PC?

    Thank you,

    Thomas


Log in to reply