@orkestrel/probe 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -805,7 +805,7 @@ var Overlay = class {
805
805
  };
806
806
  //#endregion
807
807
  //#region package.json
808
- var version = "0.0.4";
808
+ var version = "0.0.6";
809
809
  var peerDependencies = {
810
810
  "oxlint": "^1.77.0",
811
811
  "typescript": "^6.0.0",
@@ -2179,6 +2179,7 @@ var Probe = class {
2179
2179
  #lintQueue;
2180
2180
  #runtimeQueue;
2181
2181
  #deadlines = /* @__PURE__ */ new WeakSet();
2182
+ #surfaced = /* @__PURE__ */ new WeakSet();
2182
2183
  #typeTail = Promise.resolve();
2183
2184
  #arming;
2184
2185
  #closing;
@@ -2260,7 +2261,7 @@ var Probe = class {
2260
2261
  this.#emitter.emit("prove", verdict);
2261
2262
  return verdict;
2262
2263
  } catch (error) {
2263
- this.#emitter.emit("error", error);
2264
+ if (!(error instanceof ProbeError) || !this.#surfaced.has(error)) this.#emitter.emit("error", error);
2264
2265
  throw error;
2265
2266
  }
2266
2267
  }
@@ -2285,18 +2286,30 @@ var Probe = class {
2285
2286
  await this.#arming;
2286
2287
  }
2287
2288
  async #arm() {
2288
- const created = this.#workbench();
2289
+ let created;
2290
+ try {
2291
+ created = this.#workbench();
2292
+ } catch (error) {
2293
+ this.#surface(error);
2294
+ throw error;
2295
+ }
2289
2296
  try {
2290
2297
  await this.#boot(created);
2291
2298
  } catch (error) {
2292
- throw new ProbeError(`The probe could not arm: ${describeUnknown(error)}`, {
2299
+ const failure = new ProbeError(`The probe could not arm: ${describeUnknown(error)}`, {
2293
2300
  origin: "instrument",
2294
2301
  code: "malformed",
2295
2302
  cause: error
2296
2303
  });
2304
+ this.#surface(failure);
2305
+ throw failure;
2297
2306
  }
2298
2307
  this.#emitter.emit("arm", this.#toolchain);
2299
2308
  }
2309
+ #surface(error) {
2310
+ if (error instanceof ProbeError) this.#surfaced.add(error);
2311
+ this.#emitter.emit("error", error);
2312
+ }
2300
2313
  #workbench() {
2301
2314
  const path = "tmp/probe";
2302
2315
  const directory = resolveWorkspaceFile(this.#workspace, path);