Setu-TS
    Preparing search index...

    Function attachConnectionErrorReporter

    • Attaches a reporter to a client's 'error' and 'ready' events.

      Call it ONLY on a client the package built itself. An injected client belongs to the caller, and adding an 'error' listener to it would silence the caller's own handling (ioredis falls back to the console only when no listener exists). The client is checked structurally at runtime, so the package's injection facade need not declare on.

      With no reporter, the listeners are still attached and drop every event — the same outcome as a reporter whose logger returns undefined. A built client therefore never writes to the console, whether or not its owner supplied a log sink; the owning package's health probe still reports the outage.

      Parameters

      • client: unknown

        The built client; an object exposing an on method

      • reporter: ConnectionErrorReporter = DROPPING_REPORTER

        The reporter to route events to; omitted, events are dropped

      Returns boolean

      true when the listeners were attached, false when the client exposes no on method

      0.8.0