"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var BdxError_exports = {};
__export(BdxError_exports, {
  BdxError: () => BdxError,
  BdxStatusResponseError: () => BdxStatusResponseError
});
module.exports = __toCommonJS(BdxError_exports);
var import_general = require("#general");
var import_types = require("#types");
/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
class BdxError extends import_general.MatterError {
  #code;
  bytesTransferred = 0;
  totalBytesLength;
  constructor(message, code = import_types.BdxStatusCode.Unknown) {
    super(`BDX error ${import_types.BdxStatusCode[code]}(${code}): ${message}`);
    this.#code = code;
  }
  get code() {
    return this.#code;
  }
  static is(error) {
    return error instanceof BdxError;
  }
}
class BdxStatusResponseError extends import_general.MatterError {
  constructor(message, generalStatusCode, protocolStatusCode) {
    super(
      `(${import_types.GeneralStatusCode[generalStatusCode]} (${generalStatusCode}) / ${import_types.BdxStatusCode[protocolStatusCode]} (${protocolStatusCode})) ${message}`
    );
    this.generalStatusCode = generalStatusCode;
    this.protocolStatusCode = protocolStatusCode;
  }
}
//# sourceMappingURL=BdxError.js.map
