iya-sts
    Preparing search index...

    Where unexpected errors are contained: the process handlers and the Express guard.

    A static utility class; its state is the throttle and the counts.

    Index
    • How many faults of each kind this process has contained.

      Returns { [kind: string]: string | number }

      a copy of the counts, and the last reason a fault could not be logged

    • Extends Express 4's own try around a handler to the promise the handler returns, so that a rejected async handler reaches next() as a 500 rather than becoming an unhandled rejection. Patches the one prototype every router's layers share, so it covers every express app in the process; a second call does nothing.

      Parameters

      • log: FaultLog

        the logger for the faults it contains

      Returns boolean

      whether the guard is in place

    • Listens for uncaughtException and unhandledRejection on this process, logs each (throttled) and lets the process carry on. Call it once the process has started; a second call does nothing.

      Parameters

      • role: string

        what this process is, for the log line ("front process", "request worker")

      • log: FaultLog

        the process's logger

      Returns boolean

      whether this call installed them