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

    Function toModbusError

    • Converts a raw Error from modbus-rs into a typed ModbusError.

      Uses getModbusErrorCode to classify the error by its internal error code, then constructs the appropriate Data.TaggedError variant. Unknown/unrecognized codes fall through to ModbusInternalError.

      Parameters

      • cause: Error

        The raw Error thrown by a modbus-rs API call.

      Returns ModbusError

      A typed ModbusError variant matching the error code.

      • getModbusErrorCode — Upstream function that extracts the error discriminant.
      • ModbusErrorCode — Enum of possible error codes.