• Javascript error message handling

    From Michael Long@1:229/2 to All on Thursday, October 08, 2020 06:09:59
    From: mplong@gmail.com

    Is there a way from javascript to handle the error like the C function errormsg, where it writes it to the consoles with red "The sysop has been notified" and puts it in the log?

    --- SoupGate-Win32 v1.05
    * Origin: www.darkrealms.ca (1:229/2)
  • From echicken@1:229/2 to All on Thursday, October 08, 2020 10:28:01
    From: echicken@ECBBS.remove-tha-this

    To: Michael Long
    Re: Javascript error message handling
    By: Michael Long to alt.bbs.synchronet on Thu Oct 08 2020 06:09:59

    Is there a way from javascript to handle the error like the C function
    errormsg, where it writes it
    to the consoles with red "The sysop has been notified" and puts it in the
    log?

    Sure:

    try {
    doSomethingThatMightThrowAnException();
    } catch (err) {
    log(LOG_ERR, err);
    console.putmsg('\1+\1h\1r' + err + '\1-\r\n');
    }

    There's lots to be read online about error handling in JS, including the optional and rarely useful 'finally' block.

    ---
    echicken
    electronic chicken bbs - bbs.electronicchicken.com
    þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.com
    --- Synchronet 3.18c-Win32 NewsLink 1.113
    * Vertrauen - Riverside County, California - telnet://vert.synchro.net

    --- SoupGate-Win32 v1.05
    * Origin: www.darkrealms.ca (1:229/2)
  • From Digital Man@1:229/2 to All on Thursday, October 08, 2020 11:14:01
    From: digital.man@vert.synchro.net.remove-txc-this

    To: Michael Long
    Re: Javascript error message handling
    By: Michael Long to alt.bbs.synchronet on Thu Oct 08 2020 06:09 am

    From Newsgroup: alt.bbs.synchronet

    Is there a way from javascript to handle the error like the C function errormsg, where it writes it to the consoles with red "The sysop has been notified" and puts it in the log?

    There's no single function that does that in Sync-JHS, but this would be very similar:

    alert(log(LOG_ERR, "Some error happened") + ", sysop has been notified");

    digital man

    Rush quote #11:
    Struck between the eyes by the big time world, walking uneasy streets
    Norco, CA WX: 68.1øF, 74.0% humidity, 2 mph NNW wind, 0.00 inches rain/24hrs --- Synchronet 3.18c-Win32 NewsLink 1.113
    * Vertrauen - Riverside County, California - telnet://vert.synchro.net

    --- SoupGate-Win32 v1.05
    * Origin: www.darkrealms.ca (1:229/2)