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)