Skip to content

Commit

Permalink
add schematic error type
Browse files Browse the repository at this point in the history
  • Loading branch information
seveibar committed May 10, 2024
1 parent dc92f20 commit 3a3645d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/schematic/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ export * from "./schematic_trace"
export * from "./schematic_text"
export * from "./schematic_port"
export * from "./schematic_net_label"
export * from "./schematic_error"
14 changes: 14 additions & 0 deletions src/schematic/schematic_error.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { z } from "zod"

export const schematic_error = z
.object({
schematic_error_id: z.string(),
type: z.literal("schematic_error"),
// eventually each error type should be broken out into a dir of files
error_type: z.literal("schematic_port_not_found"),
message: z.string(),
})
.describe("Defines a schematic error on the schematic")

export type SchematicErrorInput = z.input<typeof schematic_error>
export type SchematicError = z.infer<typeof schematic_error>

0 comments on commit 3a3645d

Please sign in to comment.