docs: def raise_if_error(frame):
      """
      Checks a frame and raises the relevant exception if required.
      """
      if "status" not in frame or frame["status"] == b"\x00":
          return
      codes_and_exceptions = {
          b"\x01": exceptions.ZigBeeUnknownError,
          b"\x02": exceptions.ZigBeeInvalidCommand,
          b"\x03": exceptions.ZigBeeInvalidParameter,
          b"\x04": exceptions.ZigBeeTxFailure
      }
      if frame["status"] in codes_and_exceptions:
          raise codes_and_exceptions[frame["status"]]()
      raise exceptions.ZigBeeUnknownStatus()