From afe05bd3df709126204d2fc79f4bfadf8a397f21 Mon Sep 17 00:00:00 2001 From: Ryan Vermooten Date: Mon, 5 Jun 2023 14:31:33 +0200 Subject: [PATCH] docs: update ref to discriminated-unions docs --- 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.