Handle return "validation" errors #256
-
Is there a method similar to I've seen the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
In fact, I have been suggesting to the author for a very long time to make a validation error handling function, but unfortunately the author of the library ignores me. I don't remember what I wrote then, but there really isn't enough function like You can call it something like this: You can also add the second arguments of This feature can be added both for individual schemes and for the general client |
Beta Was this translation helpful? Give feedback.
-
Hi, the server error shape is a global setting because all the actions share the same returned server error type. However, validation errors are determined by the schema you pass to the action you're defining, that's why it wouldn't make any sense to set an option at the global client level, other than a generic |
Beta Was this translation helpful? Give feedback.
Hi, the server error shape is a global setting because all the actions share the same returned server error type. However, validation errors are determined by the schema you pass to the action you're defining, that's why it wouldn't make any sense to set an option at the global client level, other than a generic
"flattened" | "formatted"
default shape. The client is used to define all the actions of your application, there's just no way to know the specific schemas (and so, validation errors types) of all your actions at the top level of the hierarchy, it's impossible. Hope this clears things up!