• Exceptions

    From Digital Man to All on Sunday, August 23, 2020 16:53:44
    Request:
    When writing or updating a JS module, if you're going to "throw" an exception, please throw an Error object (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) rather than a string.

    Do this:
    throw new Error('something bad');
    Not this:
    throw('something bad');

    This allows the location (file name and line number) of the error to be displayed and logged in the upper layers (e.g. sbbs).

    There are other *Error constructors too, if you prefer to throw one of those.

    Thanks!

    digital man

    Synchronet/BBS Terminology Definition #73:
    SSL = Secure Sockets Layer (precursor to TLS)
    Norco, CA WX: 88.6°F, 52.0% humidity, 14 mph ENE wind, 0.00 inches rain/24hrs