/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { MatterError } from "#general";
import { BdxStatusCode, GeneralStatusCode } from "#types";
class BdxError extends MatterError {
  #code;
  bytesTransferred = 0;
  totalBytesLength;
  constructor(message, code = BdxStatusCode.Unknown) {
    super(`BDX error ${BdxStatusCode[code]}(${code}): ${message}`);
    this.#code = code;
  }
  get code() {
    return this.#code;
  }
  static is(error) {
    return error instanceof BdxError;
  }
}
class BdxStatusResponseError extends MatterError {
  constructor(message, generalStatusCode, protocolStatusCode) {
    super(
      `(${GeneralStatusCode[generalStatusCode]} (${generalStatusCode}) / ${BdxStatusCode[protocolStatusCode]} (${protocolStatusCode})) ${message}`
    );
    this.generalStatusCode = generalStatusCode;
    this.protocolStatusCode = protocolStatusCode;
  }
}
export {
  BdxError,
  BdxStatusResponseError
};
//# sourceMappingURL=BdxError.js.map
