@flux-control/effect-modbus-rs
    Preparing search index...

    Class ModbusUnitAlreadyDeclaredError

    Error indicating that a unit already has a batching client on this transport.

    This is a local error. modbus-rs never returns it. The transport raises it from withBatchingClient when the unit has a completed declaration or a declaration in progress.

    The declaration belongs to the transport scope, not to the caller. It stays after its caller is interrupted, and after the owner that made it closes. Catch this error to recover the existing client with batchingClient(unitId).

    This error is not a member of ModbusError. It can occur only when a caller declares a unit. It never occurs on the bus, so retry policies do not apply to it.

    const client = yield* transport.withBatchingClient(3).pipe(
    Effect.catchTag('ModbusUnitAlreadyDeclaredError', (error) =>
    transport.batchingClient(error.unitId),
    ),
    );

    Hierarchy

    • YieldableError<this> & {} & Readonly<
          { cause: Error; message: string; unitId: number },
      >
      • ModbusUnitAlreadyDeclaredError
    Index
    • Parameters

      • args: { cause: Error; message: string; unitId: number }
        • Readonlycause: Error

          A descriptive error.

        • Readonlymessage: string

          Human-readable explanation of the error.

        • ReadonlyunitId: number

          The unit that already has a batching client.

      Returns ModbusUnitAlreadyDeclaredError

    cause: Error

    The cause of the error.

    message: string

    Human-readable explanation of the error.

    unitId: number

    The unit that already has a batching client.