@tscircuit/core 0.0.472 → 0.0.473

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.
Files changed (2) hide show
  1. package/dist/index.js +21 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5902,6 +5902,18 @@ import "@tscircuit/schematic-autolayout";
5902
5902
 
5903
5903
  // lib/utils/autorouting/CapacityMeshAutorouter.ts
5904
5904
  import { CapacityMeshSolver } from "@tscircuit/capacity-autorouter";
5905
+
5906
+ // lib/errors/AutorouterError.ts
5907
+ import packageJson from "@tscircuit/capacity-autorouter/package.json";
5908
+ var autorouterVersion = packageJson.version ?? "unknown";
5909
+ var AutorouterError = class extends Error {
5910
+ constructor(message) {
5911
+ super(`${message} (capacity-autorouter@${autorouterVersion})`);
5912
+ this.name = "AutorouterError";
5913
+ }
5914
+ };
5915
+
5916
+ // lib/utils/autorouting/CapacityMeshAutorouter.ts
5905
5917
  var CapacityMeshAutorouter = class {
5906
5918
  input;
5907
5919
  isRouting = false;
@@ -5944,7 +5956,7 @@ var CapacityMeshAutorouter = class {
5944
5956
  if (this.solver.failed) {
5945
5957
  this.emitEvent({
5946
5958
  type: "error",
5947
- error: new Error(this.solver.error || "Routing failed")
5959
+ error: new AutorouterError(this.solver.error || "Routing failed")
5948
5960
  });
5949
5961
  } else {
5950
5962
  this.emitEvent({
@@ -5986,7 +5998,7 @@ var CapacityMeshAutorouter = class {
5986
5998
  } catch (error) {
5987
5999
  this.emitEvent({
5988
6000
  type: "error",
5989
- error: error instanceof Error ? error : new Error(String(error))
6001
+ error: error instanceof Error ? new AutorouterError(error.message) : new AutorouterError(String(error))
5990
6002
  });
5991
6003
  this.isRouting = false;
5992
6004
  }
@@ -6042,7 +6054,7 @@ var CapacityMeshAutorouter = class {
6042
6054
  solveSync() {
6043
6055
  this.solver.solve();
6044
6056
  if (this.solver.failed) {
6045
- throw new Error(this.solver.error || "Routing failed");
6057
+ throw new AutorouterError(this.solver.error || "Routing failed");
6046
6058
  }
6047
6059
  return this.solver.getOutputSimpleRouteJson().traces || [];
6048
6060
  }
@@ -7381,12 +7393,15 @@ var Group = class extends NormalComponent {
7381
7393
  break;
7382
7394
  }
7383
7395
  if (job.has_error) {
7396
+ const err = new AutorouterError(
7397
+ `Autorouting job failed: ${JSON.stringify(job.error)}`
7398
+ );
7384
7399
  db.pcb_autorouting_error.insert({
7385
7400
  pcb_error_id: autorouting_job.autorouting_job_id,
7386
7401
  error_type: "pcb_autorouting_error",
7387
- message: job.error?.message ?? JSON.stringify(job.error)
7402
+ message: err.message
7388
7403
  });
7389
- throw new Error(`Autorouting job failed: ${JSON.stringify(job.error)}`);
7404
+ throw err;
7390
7405
  }
7391
7406
  await new Promise((resolve) => setTimeout(resolve, 100));
7392
7407
  }
@@ -9837,7 +9852,7 @@ import { identity as identity4 } from "transformation-matrix";
9837
9852
  var package_default = {
9838
9853
  name: "@tscircuit/core",
9839
9854
  type: "module",
9840
- version: "0.0.471",
9855
+ version: "0.0.472",
9841
9856
  types: "dist/index.d.ts",
9842
9857
  main: "dist/index.js",
9843
9858
  module: "dist/index.js",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.472",
4
+ "version": "0.0.473",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",