From ae0f7a2c15e7741ee1b23c03a3bfb9acebd86551 Mon Sep 17 00:00:00 2001 From: Ryan Vermooten Date: Fri, 29 Sep 2023 15:00:34 +0200 Subject: [PATCH] docs: update ref to discriminated-unions docs (#2485) Co-authored-by: Ryan Vermooten --- ERROR_HANDLING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ERROR_HANDLING.md b/ERROR_HANDLING.md index 027176d45..f2e0b8e62 100644 --- a/ERROR_HANDLING.md +++ b/ERROR_HANDLING.md @@ -24,7 +24,7 @@ Each ZodError has an `issues` property that is an array of `ZodIssues`. Each iss ## ZodIssue -`ZodIssue` is _not_ a class. It is a [discriminated union](https://www.typescriptlang.org/docs/handbook/advanced-types.html#discriminated-unions). +`ZodIssue` is _not_ a class. It is a [discriminated union](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#discriminated-unions). The link above is the best way to learn about the concept. Discriminated unions are an ideal way to represent a data structures that may be one of many possible variants. You can see all the possible variants defined [here](./src/ZodError.ts). They are also described in the table below if you prefer.