Verified Commit 2348214b authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃
Browse files

fixup! Bug 40597: Implement TorSettings module

Do not freeze TorConnectError.
parent b934b41b
Loading
Loading
Loading
Loading
+18 −7
Original line number Diff line number Diff line
@@ -47,12 +47,24 @@ export const TorConnectState = Object.freeze({
});

export class TorConnectError extends Error {
  static Offline = "Offline";
  static BootstrapError = "BootstrapError";
  static CannotDetermineCountry = "CannotDetermineCountry";
  static NoSettingsForCountry = "NoSettingsForCountry";
  static AllSettingsFailed = "AllSettingsFailed";
  static ExternalError = "ExternalError";
  static get Offline() {
    return "Offline";
  }
  static get BootstrapError() {
    return "BootstrapError";
  }
  static get CannotDetermineCountry() {
    return "CannotDetermineCountry";
  }
  static get NoSettingsForCountry() {
    return "NoSettingsForCountry";
  }
  static get AllSettingsFailed() {
    return "AllSettingsFailed";
  }
  static get ExternalError() {
    return "ExternalError";
  }

  constructor(code, cause) {
    super(cause?.message ?? `TorConnectError: ${code}`, cause ? { cause } : {});
@@ -60,7 +72,6 @@ export class TorConnectError extends Error {
    this.code = code;
  }
}
Object.freeze(TorConnectError);

ChromeUtils.defineLazyGetter(
  lazy,