It extends TypeError so existing catch (e) { if (e instanceof TypeError) }
code keeps working, and adds issues: the structured, machine-readable list
of everything that went wrong. Branch on issue.code and issue.path
rather than parsing message, which is formatted for humans and may change.
The error every validation failure raises.
It extends
TypeErrorso existingcatch (e) { if (e instanceof TypeError) }code keeps working, and addsissues: the structured, machine-readable list of everything that went wrong. Branch onissue.codeandissue.pathrather than parsingmessage, which is formatted for humans and may change.Example