/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { Diagnostic, Logger } from "@matter/general";
import { ConformanceError, DatatypeError, UnknownEnumValueError } from "@matter/protocol";
import { Status } from "@matter/types";
const logger = Logger.get("ValueValidator");
function forwardValidationToPeer(session, error) {
  if (session.clientPeerContext === void 0) {
    return false;
  }
  if (error instanceof ConformanceError || error instanceof UnknownEnumValueError || error instanceof DatatypeError && error.code === Status.ConstraintError) {
    logger.debug(
      "Forwarding non-conformant write to peer; the device may reject it:",
      Diagnostic.errorMessage(error)
    );
    return true;
  }
  return false;
}
export {
  forwardValidationToPeer
};
//# sourceMappingURL=peer-forwarding.js.map
