You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The first thing that comes to my mind, a new registry could be provided like TypeRegistry but for errors.
In errors/errors.ts#FromKind function the checker is resolved from the registry so the error creation function could also be provided. Even better TypeRegistry.Set function could accept an additional argument for this.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, I couldn't find if this is asked or there is an example, if so, sorry for that.
Here is an implementation of
OneOf
, it is not bullet-proof but it helps with my question.Everyhting works so far, but instead of showing
Expected kind 'UnionOneOf'
error message, I would like to show the narrowed error.In this block I already narrow down the schema, but the error is not.
Is there any way to narrow down the error too ?
The first thing that comes to my mind, a new registry could be provided like
TypeRegistry
but for errors.In errors/errors.ts#FromKind function the checker is resolved from the registry so the error creation function could also be provided. Even better TypeRegistry.Set function could accept an additional argument for this.
Beta Was this translation helpful? Give feedback.
All reactions